Form Variables can be useful because you can store string values into them that are persisted across object events as opposed to variables created locally (within scripted events) which are destroyed at the end of every event.
You can create Form Variables by going to the Variables tab within the Form Properties dialog, accessed via the main File menu.
The catch is in the way you get and set their values: If you’re writing a *FormCalc* script, then you can manipulate them just like any other variable. For example, let’s say you define one named “MyVar”. In your script, you can then write
bc. MyVar = “test”
to assign the value “test” to it and you can write
to display its value in a message box.
bc. GeneralError: Operation failed.
Argument mismatch in property or function argument
If you look at the XFA definition of the variable, it looks like this:
bc. MyVar.value = “test”; // set the value
xfa.host.messageBox(MyVar.value); // get the value
Just like being able to simply write a field’s name like this in a *FormCalc* script in order to access its value
as opposed to having to write