pTAL Reference Manual (H06.03+)
Expressions
HP pTAL Reference Manual—523746-005
5-24
Group Comparison
You can nest IF expressions within an IF expression or within other expressions. The
IF expression resembles the IF on page 12-26 except that the IF expression:
•
Requires the ELSE clause
•
Contains expressions, not statements
Examples of IF expressions:
1. This example assigns an arithmetic expression to var based on the condition
length > 0:
var := IF length > 0 THEN 10 ELSE 20;
2. This example nests an IF expression (in parentheses) within another expression:
var * index + (IF index > limit THEN var * 2 ELSE var * 3)
3. This example nests an IF expression within another IF expression:
var := IF length < 0 THEN -1
ELSE IF length = 0 THEN 0
ELSE 1;
Group Comparison
The group comparison expression compares a variable with a variable or constant.
With PVU T9248AAD, you can compare any variable up to the current maximum
allowed size for any object of 127.5 megabytes.
var-1
is the identifier of a variable, with or without an index, that you want to compare to
var-2, constant, or constant-list. var-1 can be a simple variable, array,
simple pointer
, structure, structure data item, or structure pointer, but not a read-
only array.
var-1 relational-operator
var-2
FOR
count
count-unit
constant[ ]
constant
constant-list
-> next-addr
VST015.vsd










