pTAL Reference Manual (H06.08+)

Expressions
HP pTAL Reference Manual523746-006
5-16
Conditional Expressions
Table 5-11. Conditional Expressions
Syntax Example
condition a
NOT condition NOT a
condition OR condition a OR b
condition AND condition a AND b
condition AND NOT condition a AND NOT b OR c
Table 5-12. Conditions in Conditional Expressions
Element Description Example
Relational
expression
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.
If a = b THEN ...
Group
comparison
expression
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.
IF a = b FOR 20 WORDS THEN ...
(conditional
expression)
A conditional expression enclosed
in parentheses. The result type is
INT; a -1 if true or a 0 if false. The
example is true if both B and C
are false. The system evaluates
the parenthesized condition first,
then applies the NOT operator.
IF NOT (b OR c) THEN ...
Arithmetic
expression
An arithmetic, assignment, CASE,
or IF expression
that has an INT
or INT(32) result
*
. The 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 x THEN ...
Relational
operator
A signed or unsigned relational
operator that tests a condition
code. Condition code settings are
CCL (negative), CCE (0), or CCG
(positive). The example is true if
the condition code setting is CCL.
IF < THEN ...
*
If an arithmetic expression has a result other than INT, use a signed relational expression.