TAL Reference Manual
TAL Reference Manual—526371-001
8-1
8 Structures
A structure is a collectively stored set of data items that you can access individually or
as a group. Structures contain structure items (fields) such as simple variables, arrays,
simple pointers, structure pointers, and nested structures (called substructures). The
structure items can be of different data types.
Structures usually contain related data items such as the fields of a file record. For
example, in an inventory control application, a structure can contain an item number,
the unit price, and the quantity on hand.
This section describes the syntax for declaring:
•
Definition structures
•
Template structures
•
Referral structures
•
Structure items—simple variables, arrays, substructures, filler bytes, filler bits,
simple pointers, structure pointers, and redefinitions
Section 8, “Using Structures,” in the
TAL Programmer’s Guide describes:
•
How the compiler aligns structures and structure items
•
How the compiler allocates storage for structures
•
How to declare arrays of arrays, arrays of structures, and multidimensional arrays
•
How you can access structures and structure items
Kinds of Structures
A structure declaration associates an identifier with any of three kinds of structures, as
listed in Table 8-1
.
Table 8-1. Kinds of Structures
Structure Description
Definition Describes a structure layout and allocates storage for it
Template Describes a structure layout but allocates no storage for it
Referral Allocates storage for a structure whose layout is the same as the layout of a
previously declared structure