So I am trying to use Mathematica to design a DnD alignment "editor" if you will. The input I want to be provided locally via a FormFunction and will be <|"Character"->"String" , "Shift" -> {Integer , Integer} , "Reason" -> "String"|>
. I am certain I misformatted the "Shift" key, but I'm trying to portray a List
of 2 Integer
elements.
In trying to understand FormFunction
, I tried to play around with it. After a couple hours of reading and testing, I only made the following progress:
FormFunction["Test Input" -> "String" , k = Key["Test Input"]]
Typing "Test Word" into the generated form outputs:
But when I try to see the value in k
, I get the output:
Key[Test Input]
And so I am here completely clueless how FormFunction
can be used. The end goal I wish to get at is to use FormFunction
to get inputs, and apply them to Append
such that:
data = Append[data,{CHARACTER_NAME , SHIFT_LIST , REASON}]
Apologies if my question is vague, but I feel like a 5-year old trying to read Principia Mathematica with how little I understand FormFunction
and Key
.
PS: Here is my current code that I wish to integrate all that I have stated into:
SetDirectory[NotebookDirectory[]]
ifFileExists := (data = Import['alignment.xlsx'][[1]]);
ifFileNotExists := (Export["alignment.xlsx","Character","XLSX"] ; data = Import["alignment.xlsx"][[1]]; data = Append[data,{"Shift"}]; data = Append[data,{"Reason"}]; data = Transpose[data]; Export["alignment.xlsx",data,"XLSX"];);
If[FileExistsQ["alignment.xlsx"] , ifFileExists , ifFileNotExists]
Where data
is a $n \times 3$ matrix, first row being dedicated to labels.