TAL Programmer's Guide
Declaring Redefinitions
Using Structures
096254 Tandem Computers Incorporated 8–23
Definition Substructures
as Redefinitions
To declare a definition substructure that redefines a previously declared item within
the same structure, specify:
The keyword STRUCT
The identifier of the new substructure
Optional bounds—if you omit the bounds, the default bounds are [0:0] (one
occurrence)
An equal sign (=)
The identifier of a previous item at the same BEGIN-END level of the encompassing
structure—the previous item can be a simple variable, array, pointer, or
substructure
A semicolon
The substructure layout (the same BEGIN-END construct as for structures)
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.
For example, you can declare new substructure INITIALS to redefine substructure
WHOLE_NAME as follows:
STRUCT .name_record;
BEGIN
STRUCT whole_name; !Declare WHOLE_NAME
BEGIN
STRING first_name[0:10];
STRING middle_name[0:10];
STRING last_name[0:15];
END;
STRUCT initials = whole_name;
BEGIN !Redefine WHOLE_NAME as INITIALS
STRING first_initial;
FILLER 10;
STRING middle_initial;
FILLER 10;
STRING last_initial;
FILLER 15;
END;
END;