NET/MASTER Network Control Language (NCL) Reference Manual

Boolean Operators and Expressions
Expressions and Operators
10–16 106126 Tandem Computers Incorporated
Some examples of relational expressions are:
What You Type Comment
IF &a = &b THEN … Expression in an IF statement
SELECT; WHEN &a = 1 THEN … Expression in a WHEN clause in the SELECT
statement
You can compare expressions with relational operators in an IF, DO WHILE, or DO
UNTIL statement.
Boolean Operators
and Expressions
This subsection describes Boolean operators and Boolean expressions.
Boolean Operators Table 10-5 lists the Boolean operators. Operators with the same level of precedence are
grouped together.
Table 10-5. Boolean Operators
Operator Operation Meaning
\ Logical NOT Logically negates true to false or false to true.
NOT Logical NOT Logically negates true to false or false to true.
AND Logical AND Produces a true state if both adjacent conditions are true, else
false.
OR Logical inclusive OR Produces a true state if one or both conditions are true, else
false.
XOR Logical exclusive OR Produces a true state if one but not both conditions are true,
else false.
Tables 10-6 shows the results of Boolean evaluation in the form of truth tables.
Table 10-6. Truth Table for AND, OR, and XOR
AND True False OR True False XOR True False
True True False True True True True False True
False False False False True False False True False
Boolean Expressions Terms connected by AND and OR are evaluated from left to right.
In the case of AND, if a term evaluation results in a false state, the AND operation
stops and does not evaluate further terms; the result is false. If all terms equate to a
true state, the AND operation returns a result of true.