pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Figure 3 Ending Address After Comparing Strings of Data Type STRING and INT
PROC p;
BEGIN
INT x[0:1] := ["AB","CD"];
STRING y[0:1] := ["A","C"];
STRING p;
INT q;
IF x = y FOR 1 WORDS -> @p THEN ... ;
q := p; ! Assign "BC" to q
END;
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:
MeaningOperator
CCL if var-1 '<' var-2<
CCE if var-1 = var-2=
CCG if var-1 '>' var-2>
See Example 15 (page 92).
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:
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
Special Expressions 91