TAL Programmer's Guide

Declaring Template Structures
Using Structures
096254 Tandem Computers Incorporated 8–7
Declaring Template
Structures
(A template structure declares a structure layout but allocates no storage for it. You
use the template in subsequent structure, substructure, or structure pointer
declarations.
To declare a template structure, specify:
The keyword STRUCT
The structure identifier (with no indirection symbol)
An asterisk enclosed in parentheses
A semicolon
The structure layout (enclosed in a BEGIN-END construct)
For example, you can declare a template structure named STOCK like this:
STRUCT stock (
*
); !Declare template structure
BEGIN !Begin structure layout
INT item;
FIXED(2) price;
INT quantity;
END; !End structure layout
A template structure has meaning only when you refer to it in the subsequent
declaration of a referral structure (described next), a referral substructure, or a
structure pointer. The subsequent declaration allocates space for a structure whose
layout is the same as the template layout.