TAL Reference Manual
Expressions
TAL Reference Manual—526371-001
4-14
Boolean Operators
Boolean Operators
You use Boolean operators—NOT, OR, and AND—to set the state of a single value or
the relationship between two values. Table 4-9
describes the Boolean operators, the
operand types you can use with them, and the results that such operators yield.
Evaluations of Boolean Operations
Conditions connected by the OR operator are evaluated from left to right only until a
true condition occurs.
Conditions connected by the AND operator are evaluated from left to right until a false
condition occurs. The next condition is evaluated only if the preceding condition is true.
In the following example, function F will not be called because A <> 0 is false:
a := 0;
IF a <> 0 AND f(x) THEN ... ;
Effect on Hardware Indicators
Boolean operators set the condition code indicator as described in Testing Hardware
Indicators on page 4-16.
Relational Operators
Relational operators are signed or unsigned.
Signed Relational Operators
Signed relational operators perform signed comparison of two operands and return a
true or false state. Table 4-10
describes signed relational operators, operand data
types, and the results yielded by such operators.
Table 4-9. Boolean Operators and Result Yielded
Operator Operation Operand Type Result Example
NOT Boolean negation;
tests condition for
false state
STRING, INT, or
UNSIGNED(1–
16)
True/False NOT a
OR Boolean disjunction;
produces true state if
either adjacent
condition is true
STRING, INT, or
UNSIGNED(1–16)
True/False a OR b
AND Boolean conjunction;
produces true state if
both adjacent
conditions are true
STRING, INT, or
UNSIGNED(1–16)
True/False a AND b