pTAL Reference Manual (H06.08+)
Expressions
HP pTAL Reference Manual—523746-006
5-29
Group Comparison
Testing Group Comparisons
If you use a group comparison in an IF statement, you can test the condition code after
the group comparison is evaluated by setting by using the following relational operators
(with no operands) in a conditional expression:
See Example 5-5 on page 5-30.
The compiler does a standard comparison and returns a 16-bit next-addr if:
•
Both var-1 and var-2 have standard byte addresses
•
Both var-1 and var-2 have standard word addresses
The compiler does an extended comparison (which is slightly less efficient) and returns
a 32-bit next-addr if:
•
Either var-1 or var-2 has a standard byte address and the other has a
standard word address
•
Either var-1 or var-2 has an extended address
Variables (including structure data items) are byte addressed or word addressed as
follows:
After an element comparison, next-addr might point into the middle of an element,
rather than to the beginning of the element, because next-addr always refers to the
first byte or 16-bit word (as appropriate) that differs.
Example 5-5 on page 5-30 compares two arrays and then tests the condition code
setting to see if the value of the element in d_array that stopped the comparison is
less than the value of the corresponding element in s_array.
Operator Meaning
< CCL if var-1 '<' var-2
= CCE if var-1 = var-2
> CCG if var-1 '>' var-2
Byte addressed STRING simple variables
STRING arrays
Variables to which STRING simple pointers point
Variables to which STRING structure pointers point
Substructures
Word addressed INT, INT(32), FIXED, REAL, or REAL(64) simple variables
INT, INT(32), FIXED, REAL, or REAL(64) arrays
Variables to which INT, INT(32), FIXED, REAL, or REAL(64) simple
pointers point
Variables to which INT structure pointers point
Structures










