TAL Programmer's Guide

Naming Compilation Units
Structuring Programs
3–4 096254 Tandem Computers Incorporated
Naming
Compilation Units
You can assign an identifier to the compilation unit by using the NAME declaration. If
present, the NAME declaration must be the first declaration in the compilation unit.
For example, you can assign the identifier INPUT_MODULE to a compilation unit as
follows:
NAME input_module;
Normally, you include the NAME declaration in compilation units that you compile
separately and then bind together by using Binder. You must include the NAME
declaration in a compilation unit that contains blocked global data (those declared
within BLOCK declarations).
Declaring Data You declare data to associate identifiers with memory locations. Table 3-1 lists the
data items you must declare before you access them.
Table 3-1. Data Declarations
Data Item Description
LITERAL A named constant
DEFINE A named sequence of text
Simple variable A variable that contains one element of a specified data type
Array A variable that contains multiple elements of the same data type
Structure A variable that contains variables of different data types
Simple pointer A variable that contains a memory address, usually of a simple variable or
an array element, which you can access with this simple pointer
Structure pointer A variable that contains the memory address of a structure, which you can
access with this structure pointer
Equivalenced variable An alternate identifier and description for a previously declared variable
When you declare a variable, you specify at least a data type and an identifier. For
example, you can declare a simple variable named TOTAL of data type INT as follows:
INT total;