NET/MASTER Network Control Language (NCL) Reference Manual
Variable Name Syntax
Variables
106126 Tandem Computers Incorporated 9–7
Compound Variables A compound variable is a variable that begins with a stem variable and contains
segments or substems between periods (.). The general form of a compound variable
is the following:
&
stem
.
substem
[.[
substem
] ] …
substem
is one of:
[
prefix
][
curly-spec
]
[
prefix
]&
variable
stem
is either a simple or complex variable.
prefix
is a constant and can consist of any character in Table 9-1 except the ampersand,
period, opening parenthesis, closing parenthesis, opening brace, or closing brace.
A prefix can start with any character in its set.
curly-spec
must be one of the following, enclosed in parentheses ({ }):
An unsigned number in the range 0 (zero) through 999999.
A variable reference in which the variable contains an unsigned number in the
range 0 (zero) through 999999.
&
variable
is a simple, complex, or nested variable reference.
You can use compound variables to simulate arrays with indexing, as in the following
example:
&data.&index
The presence of the period separating the two parts of the compound variable in the
previous example makes the index part (the second part after the period)
data-transparent. The variable &index can represent any combination of characters.
This is in contrast to the index part of a complex variable, which when combined with
&data, must represent a valid, simple variable name. See the previous discussion on
indexing with complex variables for related information.
To initialize the value of a compound variable, you assign a value to the stem. If you
have not assigned a value to the stem, the value is null. For example, if you initialize
&TOTAL. using the assignment statement &TOTAL=0, all variables under the stem
&TOTAL. take on the value of 0 (zero). If you access the variable &TOTAL.WEEK
before you assign a value to this variable, NCL returns the value 0 (zero).