pTAL Reference Manual (H06.08+)

Expressions
HP pTAL Reference Manual523746-006
5-26
Group Comparison
count-unit
is BYTES, WORDS, or ELEMENTS. count-unit changes the meaning of
count to the following:
If count-unit is specified and is not BYTES, WORDS, or ELEMENTS, the
compiler issues an error. If you specify BYTES, WORDS, or ELEMENTS, the term
cannot also appear as an identifier in a LITERAL or DEFINE declaration in the
global declarations or in any procedure or subprocedure in which the group
comparison expression appears.
constant
is a number, a character string, or a LITERAL to which var-1 is compared.
If you enclose a simple numeric constant in brackets ([ ]) and if the destination has
a byte address or is a STRING structure pointer, the system compares a single
byte regardless of the size of constant. If you do not enclose constant in
brackets or if the destination has a word address or is an INT structure pointer, the
system compares a word, doubleword, or quadrupleword as appropriate for the
size of constant.
BYTES Compares count bytes; however, if var-1 and var-2 both
have word addresses, BYTES implicitly generates a word
comparison for (count +1)/2 words.
WORDS Compares count words.
ELEMENTS Compares count elements. The elements compared depend on
the nature of var-2 and its data type as follows:
var-2 Data Type Units Compared
Simple variable, array,
simple pointer (including
those declared in
structures)
STRING
INT
INT(32) or REAL
FIXED or REAL(64)
Bytes
Words
Doublewords
Quadruplewords
Structure
(For structure pointers,
STRING and INT have
meaning only in group
comparison expressions
and move statement
s.)
Not applicable Structure
occurrences
Substructure Not applicable Substructure
occurrences
Simple variable, array,
simple pointer (including
those declared in
structures)
STRING
INT
INT(32) or REAL
FIXED or REAL(64)
Bytes
Words
Doublewords
Quadruplewords