TAL Reference Manual
Structures
TAL Reference Manual—526371-001
8-21
Usage Considerations
substructure-layout
is the same BEGIN-END construct as for structures. It can contain declarations for
simple variables, arrays, substructures, filler bits, filler bytes, redefinitions, simple
pointers, and structure pointers. The size of one substructure occurrence is the
size of the layout, either in odd or even bytes. The total layout for one occurrence
of the encompassing structure must not exceed 32,767 bytes.
Usage Considerations
If the previous item is a substructure and you omit the bounds or if either bound is 0,
the new substructure and the previous substructure occupy the same space and have
the same offset from the beginning of the structure.
Examples of Definition Substructure Redefinitions
1. In this example, both substructures (B and C) have odd-byte alignments.
STRUCT a;
BEGIN
STRING x;
STRUCT b; !B starts on odd byte
BEGIN
STRING y;
END;
STRUCT c = b; !Redefine B as C, also on
BEGIN ! odd byte
STRING z;
END;
END;
2. In this example, MYSUB2 redefines the left byte of the INT variable in MYSUB1 as
a STRING variable:
STRUCT mystruct;
BEGIN
STRUCT mysub1; !Declare MYSUB1
BEGIN
INT int_var;
END;
STRUCT mysub2 = mysub1; !Redefine MYSUB1 as MYSUB2
BEGIN
STRING string_var;
END;
END;