TAL Programmer's Guide

Group Comparison Expression
Using Special Expressions
096254 Tandem Computers Incorporated 13–7
Comparing Elements
When you compare elements between arrays, you can specify the ELEMENTS
keyword following the count value in the FOR clause of the group comparison
expression. For example, you can compare doubleword elements between INT(32)
arrays:
INT(32) in_array[0:19];
INT(32) out_array[0:19];
!Code to assign values to arrays
IF in_array <> out_array FOR 20 ELEMENTS THEN ... ;
When you compare array elements (as in the preceding example), the ELEMENTS
keyword is optional but provides clearer source code.
When you compare structure or substructure occurrences, you must specify the
ELEMENTS keyword in the group comparison expression:
STRUCT struct_one[0:9];
BEGIN
INT a[0:2];
INT b[0:7];
STRING c;
END;
STRUCT struct_two (struct_one)[0:9];
!Code to assign values to structures
IF struct_one = struct_two FOR 10 ELEMENTS THEN ... ;
Using the Next Address The next address is the address (returned by the group comparison expression) of the
first byte or word in var1 that does not match the corresponding byte or word in var2.
To use the next address, you can declare a simple pointer and then use its identifier
(prefixed by @) in the next-address clause in a group comparison expression. Here is
an example of the next-address clause:
–> @next_addr_ptr
Here is an example of a group comparison expression that includes the next-address
clause:
array_one = array_two FOR 100 -> @next_addr_ptr ...