NET/MASTER Network Control Language (NCL) Reference Manual
BOOLEXPR
Built-in Functions
4–20 106126 Tandem Computers Incorporated
Syntax errors in the EVAL, NOEVAL, FOLD, NOFOLD, and
subchar
parameters
result in an NCL error: a compilation error if the parameter is a constant and a
run-time error if the parameter is a variable (into which a value is substituted).
Syntax errors in the Boolean expression or data validity errors do not result in an
NCL error, but result in either INVALID or BAD.
You cannot specify constants on both sides of any operator. At least one side must
consist solely of variables.
The built-in function processes in the following order:
1. The parameters (EVAL, NOEVAL, FOLD, NOFOLD, and
subchar
) are
checked. If an error is found, it is a compilation error if the parameter is a
constant and a run-time error if the parameter is a variable.
2. The syntax of the Boolean expression is checked. If the syntax of the Boolean
expression is incorrect, processing stops and the result is INVALID.
3. Otherwise, if the NOEVAL parameter was specified, processing stops and the
result is VALID.
4. Otherwise, variables are evaluated and tests are performed:
If an invalid variable value is detected, processing stops and the result is
BAD.
Evaluation of AND and OR lists proceeds from left to right. Processing
stops for a specific expression with the first result of true (for OR) or false
(for AND). The result is either 1 (true) or false (0).
Evaluation of ANY and ALL proceeds from left to right. Comparisons of
each right list entry is performed in order against each left list entry. The
result is either 1 (true) or false (0).
5. After all expressions are evaluated, processing stops and the final result is
either true (1) or false (0).
See also the TYPECHK built-in function in this section, which lists the data types
used for type checking by the BOOLEXPR built-in function.
Examples
In the following example, the value of &a is evaluated to determine if it contains
alphabetic or numeric characters (specified by ALPHANUM). The result is true, so
NCL returns a value of 1:
&a = "ABCD"
&result = BOOLEXPR( "&a IS ALPHANUM" )
In the following example, the Boolean expression is analyzed to determine if it is valid.
It is not evaluated. NCL returns a value of VALID:
&a = "ABCD"
&result = BOOLEXPR( "&a IS ALPHANUM",, NOEVAL )