NET/MASTER Network Control Language (NCL) Reference Manual
An Overview of Expressions
Expressions and Operators
10–2 106126 Tandem Computers Incorporated
The following table lists examples of terms:
Term Type of Term
Department Symbol
"SYDNEY" Quoted string
&ABC Simple variable
&X&Z Complex variable
&TEST. Stem variable
&total.dept Compound variable
(99 + &A) Parenthesized expression
f(x,y,z) Function reference
Using Expressions in
Statements
You can use expressions in statements wherever a value is required:
As parameters to a function
As the qualifier associated with a verb keyword in a verb statement
Where a value is required in a statements
Using Expressions as Parameters to a Function
The following example illustrates how you use expressions as parameters to a
function. The statement F(LENGTH(&z)+5,&z||"extra") calls the function F and
includes two expressions. The first expression LENGTH(&z)+5 calls the built-in
function LENGTH, adds 5, and passes the result as the first parameter to F. The
second expression &z||"EXTRA" concatenates the value of &z with EXTRA and
passes the result as the second parameter to F.
Built-in functions are permitted on assignment statements, and expressions are
allowed as arguments to a built-in function. Built-in functions can be nested. The
following table lists examples of built-in functions:
Example Comment
&x = LENGTH(&z) Built-in function on an assignment statement
F(LENGTH(&z)+5,&z||"extra") Expressions used as arguments to a built-in function
LENGTH(STRIP(&weekday)) Nested built-in functions
Using Expressions as the Qualifier to a Keyword
In the following statement, an expression is used as the qualifier associated with a verb
keyword:
WRITE COLOR=&color DATA=result is &xyz+f(99)