From LiveCycle Scripting Basics, available form the documentation pages.
To define a text variable
1. Select File > Form Properties.
2. In the Variables tab, click New (Insert) .
3. In the Variables list, type a unique name for the variable and press Enter. Variable names are
case-sensitive and should not contain spaces.
4. Click once in the box to the right and type the text you want to associate with the variable.
The variable appears in the Hierarchy palette at the form level.
Using variables in calculations and scripts
After you have created form variables, you only need to reference the variable name in your calculations and scripts in order to obtain the value of the variable.
Caution: When naming variables, you should avoid using names that are identical to the names of any XML Form Object Model properties, methods, or object names. For information about XML Form Object Model properties, methods, and objects, see the Adobe XML Form Object Model Reference at www.adobe.com/devnet/livecycle/designing_forms.html.
For example, create the following form variable definitions.
New form variable
Variable name Value
In FormCalc, you can access the variable values in the same manner that you access field and object values. In this example, the values are assigned to three separate fields:
TextField1 = firstName
TextField2 = lastName
NumericField1 = age
You can also use variables in FormCalc functions in the same way, as shown in this example:
Concat( "Dear ", firstName, lastName )
TextField1.rawValue = firstName.value;
See the following links for more documentation about LiveCycle Designer: