pTAL Reference Manual (H06.03+)
Expressions
HP pTAL Reference Manual—523746-005
5-21
CASE
3. This example mixes the assignment form with a relational form. It assigns the
value of b to a, then checks for equality with 0:
IF (a := b) = 0 THEN ... ;
CASE
The CASE expression selects one of several expressions.
selector
is an arithmetic expression [INT or INT(32)] that selects the expression to evaluate.
expression-1
is an expression of any data type. If you specify more than one expression-1,
their data types must be compatible.
expression-2
is an expression whose data type is compatible with the data type of
expression-1. It is evaluated if selector does not select an expression-1.
If you omit the OTHERWISE clause and an out-of-range case occurs, results are
unpredictable.
All expressions in the CASE statement must have compatible data types:
•
Every data type is compatible with itself.
•
String and unsigned (1-16) data types are compatible with INT
•
Unsigned (17-32) data types are compatible with INT(32)
CASE selector OF BEGIN expression-1
expression-2
;
END
VST013.vsd
OTHERWISE
;










