TAL Reference Manual

Expressions
TAL Reference Manual526371-001
4-26
Group Comparison Expression
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 at the beginning of the element.
Examples of Group Comparison Expressions
1. This example 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:
INT d_array[0:9];
INT s_array[0:9];
!Code to assign values to arrays
IF d_array = s_array FOR 10 ELEMENTS -> @pointer THEN
BEGIN !They matched
!Do something
END
ELSE
IF < THEN ... ; !POINTER points to element of
!Do something else ! D_ARRAY that is less than the
! corresponding element of
! S_ARRAY
2. When you compare array elements (as in the preceding example), the ELEMENTS
keyword is optional but provides clearer source code.
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(32), or REAL(64) simple variables
INT, INT(32), FIXED, REAL(32), or REAL(64) arrays
Variables to which INT, INT(32), FIXED, REAL(32), or REAL(64) simple
pointers point
Variables to which INT structure pointers point
Structures