2.2.3 Coding rules for variables
This subsection explains the variables used in access definition files. You can use the following types of variables in access definition files:
-
Variables
-
Array variables
If not otherwise required, these variables may both be referred to collectively as variables.
- Organization of this subsection
(1) Characters that can be used in variable names
Alphanumeric characters and the underscore (_) can be used in variable names, with the exception that a variable name cannot begin with a number. In addition, note that case is treated as significant in variable names.
(2) Character strings that cannot be used as variable names
The following reserved character strings cannot be used as variable names:
NORMAL, ERROR, NODATA, MULTI, FLUSH, RENEW, NEW, ADD, CRLF
(3) Declaring variables
Before you use a variable or an array variable in an access definition file, you must first declare it. Use a [VAR] tag to declare a variable, and an [ARRAY] tag to declare an array variable. For details about how to use the [VAR] and [ARRAY] tags, see [VAR] (declare variable) and [ARRAY] (declare array variable), respectively, in 4. Tags Used in Access Definition Files.
(4) Assigning a value to a variable
Use the assignment operator (=) to assign a value to a variable.
(a) Variables
You can assign the following types of values to a variable:
-
Character strings
-
Variable values
-
Class.property values
You can code assignment statements in either of the following tags, except that assignment statements for class.property values can only be coded in the [GET_VALUE] tag.
-
[SET_VALUE] tag
-
[GET_VALUE] tag in the [CLASS_FIND], [ASSOC_FIND] and [JOIN_FIND] tags
(b) Array variables
For array variables, use the embedded function $SETARRAY to code an assignment statement.