NET/MASTER Network Control Language (NCL) Reference Manual

Variable Name Substitution
Variables
106126 Tandem Computers Incorporated 9–15
The name length of any substem generated at any step cannot exceed 250 characters.
The final length of the compound variable name after all processing cannot exceed 250
characters (excluding the initial variable designator).
After substitution, the entire compound variable name is looked up in the following
way:
1. If an exact match is found, the value is returned.
2. If an exact name is not found, only the stem is looked up. If this stem exists, the
associated default value is returned.
3. If the stem does not exist, the null value is returned.
Nested Variable
Substitution
Nested variable name substitution proceeds from right to left, according to the
substitution rules for simple, complex, stem, or compound variable names.
Furthermore, if
nest-name
starts with an ampersand, the value of
nest-name
is
looked up. For example:
&(A) evaluates to &A.
&(&A) evaluates to &NAME if &A has a value of NAME.
Substitution With Braces Substitution with braces proceeds according to the following rules:
1. If the specification within the braces ({ }) is a constant:
a. The constant is checked to ensure that it is an unsigned number in the range 0
(zero) through 999999.
b.
curly-spec
becomes part of the variable name and is placed in the
substitution buffer.
2. If the specification within the braces ({ }) is not a constant:
a. The variable is processed according to the appropriate substitution rules and
the value looked up.
b. The resulting value is checked to ensure that it is an unsigned number in the
range 0 (zero) through 999999.
c.
curly-spec
becomes part of the variable name and is placed in the
substitution buffer.
Specifications within braces are always the trailing part of a variable or a substem.
Since variable name substitution proceeds from right to left, these specifications are
normally processed first. The rest of the variable is processed according to the rules
for its type.