pTAL Reference Manual (H06.08+)
Expressions
HP pTAL Reference Manual—523746-006
5-20
Special Expressions
Special Expressions
Special expressions allow you to perform specialized arithmetic or conditional
operations.
Assignment
The assignment expression assigns the value of an expression to a variable.
variable
is the identifier of a variable in which to store the result of expression
(variable can have an optional bit-deposit field).
expression
is an expression of the same data type as variable. The result of expression
becomes the result of the assignment expression. expression is either:
•
An arithmetic expression
•
A conditional expression (excluding a relational operator with no operands), the
result of which has data type INT.
Examples of assignment expressions:
1. This example decrements a. As long as a- 1 is not 0, the condition is true and the
THEN clause is executed:
IF (a := a - 1) THEN ... ;
2. This example shows the assignment form used as an index. It decrements a and
accesses the next array element:
IF array[a := a - 1] <> 0 THEN ... ;
Table 5-16. Special Expressions
Special Expression Expression Type Description
Assignment
Arithmetic Assigns the value of an expression to a
variable
CASE
Arithmetic Selects one of several expressions
IF
Arithmetic Selects one of two expressions
Group Comparison
Conditional Performs unsigned comparison of two sets
of data
variable
:=
expression
VST012.vsd










