pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
OR
is an operator that produces a true state if at least one of its operands has the value true:
Value of a AND bValue of bValue of a
TrueTrueTrue
TrueFalseTrue
TrueTrueFalse
FalseFalseFalse
Table 33 Conditional Expressions
ExampleSyntax
acondition
NOT aNOT condition
a OR bcondition OR condition
a AND bcondition AND condition
a AND NOT b OR ccondition AND NOT condition
Table 34 Conditions in Conditional Expressions
ExampleDescriptionElement
If a = b THEN ...Two conditions connected by a relational operator.
The result type is INT; a -1 if true or a 0 if false. The
example is true if A equals B.
Relational expression
IF a = b FOR 20 WORDS THEN
...
Unsigned comparison of a group of contiguous
elements with another. The result type is INT; a -1 if
true or a 0 if false. The example compares 20 words
of two INT arrays.
Group comparison
expression
IF NOT (b OR c) THEN ...A conditional expression enclosed in parentheses.
The result type is INT; a -1 if true or a 0 if false. The
(conditional expression)
example is true if both B and C are false. The system
evaluates the parenthesized condition first, then
applies the NOT operator.
IF x THEN ...An arithmetic, assignment, CASE, or IF expression
that has an INT or INT(32) result*. The expression
Arithmetic expression
is treated as true if its value is not 0 and false if its
value is 0. The example is true if the value of X is not
0.
IF < THEN ...A signed or unsigned relational operator that tests a
condition code. Condition code settings are CCL
Relational operator
(negative), CCE (0), or CCG (positive). The example
is true if the condition code setting is CCL.
* If an arithmetic expression has a result other than INT, use a signed relational expression.
Topics:
• NOT, OR, and AND Operators (page 82)
• Relational Operators (page 83)
NOT, OR, and AND Operators
You use the operators NOT, OR, and AND to set the state of a single value or the relationship
between two values.
82 Expressions