TAL Reference Manual
TAL Reference Manual—526371-001
13-1
13 Procedures
Procedures are program units that contain the executable portions of a TAL program
and that are callable from anywhere in the program. Procedures allow you to segment
a program into discrete parts that each perform a particular task such as I/O or error
handling.
An executable program contains at least one procedure. One procedure in the program
has the attribute MAIN, which identifies it as the first procedure to execute when you
run the program.
A procedure can contain subprocedures, which are callable from various points within
the same procedure.
A function is a procedure or subprocedure that returns a value. A function is also
known as a typed procedure or typed subprocedure.
This section describes the syntax for:
•
Procedure declarations
•
Subprocedure declarations
•
Entry-point declarations
•
Label declarations
Section 11, “Using Procedures,” in the
TAL Programmer’s Guide describes:
•
How the compiler allocates storage for procedures and subprocedures
•
How you call procedures and subprocedures
•
How you pass parameters
•
What parameter masks look like