TAL Reference Manual
Expressions
TAL Reference Manual—526371-001
4-27
Bit Operations
3. To 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 here to assign values to structures
IF struct_one = struct_two FOR 10 ELEMENTS THEN ... ;
4. This example contrasts a comparison to a bracketed (single-byte) constant with a
comparison to an unbracketed (element) constant:
STRING var[0:1];
!Lots of code
IF var = [0] THEN ... ; !Compare VAR[0] to one byte
IF var = 0 THEN ... ; !Compare VAR[0:1] to two bytes
Bit Operations
You can access individual bits or groups of bits in a STRING or INT variable.
Table 4-13
lists bit operations.
Table 4-13. Bit - Operations
Bit Operation Description
Bit extraction Access a bit-extraction field in an INT expression without
altering the expression
Bit shift Shift a bit-shift field in an INT or INT(32) expression to the left
or to the right by a specified number of bits
Bit deposit Assign a bit value to a bit-deposit field in a variable (For more
information, see Section 12, Statements
)