NET/MASTER Network Control Language (NCL) Reference Manual
Concatenation Operator and Expressions
Expressions and Operators
106126 Tandem Computers Incorporated 10–17
In the case of OR, if a term equates to a true state, the OR operation stops and does not
evaluate further terms; the result is true. If all terms equate to a false state, the OR
operation returns a result of false.
All terms connected by XOR are evaluated. The XOR operation returns a true value if
only one of the terms is true.
Some examples of Boolean expressions are:
What You Type Comment
IF NOT &a THEN … If NOT &a is true, continue with the
THEN clause.
IF NOT (&a >> &b) THEN … Same as IF &a <<= &b THEN ….
IF NOT &a AND &b THEN … Same as IF (NOT &a) AND &b THEN ….
IF NOT &error AND &tokenlength > 0
THEN …
If NOT &error AND &tokenlength > 0 is
true, continue with the THEN clause.
IF NOT ¬found THEN … If found, continue with the THEN clause.
IF NOT &eof AND LENGTH(&line) > 0
THEN …
If NOT &eof AND LENGTH(&line) > 0 is
true, continue with the THEN clause.
Concatenation
Operator and
Expressions
This section discusses how to use the concatenation operator with string expressions.
Using the Concatenation
Operator
The concatenation operator (||) logically concatenates the left and right terms of an
expression and returns the result as a single character string. Some examples are listed
in the following table:
What You Type Result of Concatenation Processing
a||b ab
123||456 123456
GO||OD GOOD
(123||123)+5 123128
The last example also illustrates the importance of context in concatenation. The
expression (123||123) results in a string—not a number—of 123123. The expression
123123+5 results in a number, because the plus sign (+) is regarded as the addition
operator in this context. The final result could be regarded by the compiler as either
an unquoted string or a number, depending on the context.
Using the Blank to
Concatenate Strings
Depending on context, the blank may be regarded by the compiler as a concatenation
operator. The general rule is that it is regarded as an operator only if it is not adjacent
to other operators or to the inside of a parenthesis. A blank operator is present when
two terms are separated by an arbitrary number of blanks.
The blank concatenation operator concatenates the left and right terms of an
expression, inserting a single blank between them, and returns the result as a character
string. Any number of blanks are regarded as one blank operator.