TAL Reference Manual

Structures
TAL Reference Manual526371-001
8-17
Example of Structure Pointer Declaration
Before you reference a pointer declared in a structure, be sure to assign an address to
it by using an assignment statement, as described in Section 8, “Using Structures,” in
the
TAL Programmer’s Guide.
Example of Structure Pointer Declaration
This example shows a structure pointer declaration within a structure:
STRUCT struct_a; !Declare STRUCT_A
BEGIN
INT a;
INT b;
END;
STRUCT struct_b; !Declare STRUCT_B
BEGIN
INT .EXT struct_pointer (struct_a);
!Declare STRUCT_POINTER
STRING a;
END;
Redefinition Declaration
A redefinition declares a new identifier and sometimes a new description for a previous
item in the same structure. You can declare these kinds of redefinitions:
Simple variable redefinition
Array redefinition
Substructure redefinition
Simple pointer redefinition
Structure pointer redefinition
Redefinition Rules
The following rules apply to all redefinitions in structures:
The new item must be of the same length or shorter than the previous item.
The new item and the previous item must be at the same BEGIN-END level of a
structure.
Additional rules are given in subsections that describe each kind of redefinition in the
following pages.
Redefinitions Outside Structures
For information on redefinitions outside structures, see Section 10, Equivalenced
Variables.