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
MyVar = "test"
to assign the value “test” to it and you can write
to display its value in a message box.
GeneralError: Operation failed. XFAObject.messageBox:1:XFA:form1.#subform.Button1:click Argument mismatch in property or function argument
If you look at the XFA definition of the variable, it looks like this:
<variables> <text name="MyVar">test</text> </variables>
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
Posted by Stefan Cameron on July 16th, 2006
Filed under Scripting
Both comments and pings are currently closed.