pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 96 Definition Substructure Redefinition
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 odd byte
BEGIN
STRING z;
END;
END;
Example 97 Definition Substructure Redefinition
STRUCT mystruct;
BEGIN
STRUCT mysub1;
BEGIN
INT int_var;
END;
STRUCT mysub2 = mysub1; ! Redefine mysub1 as mysub2
BEGIN
STRING string_var;
END;
END;
Referral Substructure
A referral substructure redefinition associates a new referral substructure with a previous item at
the same BEGIN-END level of a structure.
identifier
is the identifier of the new substructure.
referral
is the identifier of a structure that provides the structure layout. You can specify any previously
declared structure (except the encompassing structure) or structure pointer. If the previous
structure has an odd-byte size, the compiler rounds the size of the new substructure up so it
has an even-byte size.
range
lower-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth substructure occurrence) of the first substructure occurrence you
want allocated. Each occurrence is one copy of the substructure.
Declaring Redefinitions 157