TAL Programmer's Guide

8 Using Structures
096254 Tandem Computers Incorporated 8–1
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,
unit price, and quantity.
Structures can simulate multidimensional arrays, arrays of arrays, or arrays of
structures.
This section describes:
Kinds of structures—definition, template, and referral
Declaring and allocating definition structures
Declaring template structures
Declaring and allocating referral structures
Declaring and allocating structure items
Accessing structure items
Assigning data to structure items
Copying structure data
Kinds of Structures A structure declaration associates an identifier with any of three kinds of structures.
Table 8-1 lists the kinds of structures you can declare.
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