NET/MASTER Network Control Language (NCL) Reference Manual
Variable Name Substitution
Variables
106126 Tandem Computers Incorporated 9–11
Simple Variable
Substitution
There is no substitution required to reference a simple variable name.
Complex Variable
Substitution
Complex variable name substitution proceeds from right to left, as shown in the
following steps:
1. The final segment is analyzed from right to left:
a. If this segment has a trailing specification in braces ({ }), it is processed
according to the rules in “Substitution With Braces,” described later in this
section.
b. Any suffix is placed into the substitution buffer.
c. The last variable is looked up to obtain its value.
d. This value is prefixed to any content of the substitution buffer.
2. Any preceding middle segment is analyzed from right to left:
a. If this segment has a numeric simple variable name (which must always have
a suffix) or a nested variable reference (which may or may not have a suffix):
1) Any suffix is prefixed to the content of the substitution buffer.
2) The numeric simple variable or nested variable is looked up to obtain its
value.
3) This value is prefixed to the content of the substitution buffer.
b. If this segment has a simple variable name that is not numeric:
1) The simple variable name is prefixed to the content of the substitution
buffer.
2) The content of the substitution buffer is validated as a valid simple
variable name and is converted to uppercase.
3) The simple variable is looked up to obtain its value. This value becomes
the content of the substitution buffer.
c. If the segment referred in Step 2b is empty:
1) The content of the substitution buffer is validated as a valid simple
variable name and is converted to uppercase.
2) The simple variable is looked up to obtain its value. This value becomes
the content of the substitution buffer.
3. Processing continues with the next preceding middle segment, according to Step 2.
If there is no other middle segment, processing continues according to Step 4.
4. The first segment is analyzed from right to left:
a. If this segment has a simple variable name:
1) The simple variable name is prefixed to the content of the substitution
buffer.