pTAL Reference Manual (H06.03+)

HP pTAL Reference Manual523746-005
14-1
14
Procedures, Subprocedures, and
Procedure Pointers
Procedures are program units that contain the executable portions of a pTAL 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.
Topics:
Procedure Declarations on page 14-2
Procedure Attributes on page 14-5
Formal Parameter Specification on page 14-10
Procedure Body on page 14-17
Subprocedure Declarations on page 14-19
Subprocedure Body on page 14-21
Entry-Point Declarations on page 14-22
Procedure Pointers on page 14-26
Labels in Procedures on page 14-37
In this section, references to procedures refers to procedures and subprocedures
unless otherwise specified.