NET/MASTER Network Control Language (NCL) Reference Manual
Assignment Statement
Core Statements
106126 Tandem Computers Incorporated 2–3
Assignment Statement The assignment core statement assigns the value of an expression to a specified
variable.
variable
= [
expression
]
variable
specifies a valid variable reference, including the initial variable designator (&).
Complex, compound, and nested variables are evaluated to generate a final
simple variable name. You can assign a value to the following system variables:
&SYS.RETCODE, &SYS.PANEL.SKIP, and &SYS.LOOPCTL. See Section 5,
“System Variables,” that contains a list and description of all NCL system
variables.
expression
specifies an expression that, when evaluated, becomes the value assigned to
variable
. Omitting
expression
sets
variable
to a null value. You can
specify any legal expression.
Note See Section 10, “Expressions and Operators,” for a discussion and definition of legal expressions. See
also Section 9, “Variables,” for a description of simple, stem, complex, compound, and nested variables.
Considerations
An assignment statement is recognized if the first, non-label, lexical element in a
statement is a valid variable and the second lexical element is the equal sign (=)
operator. See Section 8, “Compiler Operation,” for a definition of valid NCL
labels.
Assignment to a stem variable deletes all existing compound variables starting
with that stem name.
expression
then becomes the default value for that stem
name.
See the ASSIGN, DROP, and PARSE verbs in Section 3, “Verbs.” The ASSIGN
verb (in one of its formats) can assign a list or a range of values to multiple
variables. The DROP verb deletes variable names. The PARSE verb creates
variables from text.
Examples
In the following example, the value of the expression (123+456) is evaluated to 579 and
assigned to the variable &A:
&A = 123 + 456
The following example assigns TOM SMITH to the variable &ABC:
&ABC = TOM SMITH