pTAL Reference Manual (H06.08+)

Introduction to pTAL
HP pTAL Reference Manual523746-006
1-4
pTAL Features
pTAL Features
Procedures on page 1-4
Subprocedures on page 1-4
Private Data Area on page 1-4
Recursion on page 1-5
Parameters on page 1-5
Data Types on page 1-5
Data Grouping on page 1-5
Pointers on page 1-6
Data Operations on page 1-6
Bit Operations on page 1-6
Built-in Routines on page 1-6
Compiler Directives on page 1-6
Modular Programming on page 1-6
Procedures
Each pTAL program contains one or more procedures. A procedure is a discrete
sequence of declarations and statements that performs a specific task. A procedure is
callable from anywhere in the program.
Each procedure executes in its own environment and can contain local variables that
are not affected by the actions of other procedures. When a procedure calls another
procedure, the operating system saves the callers environment and restores that
environment when the called procedure returns control to the caller.
Subprocedures
A procedure can contain subprocedures, callable only from within the same procedure.
A subprocedure can have sublocal variables that are not affected by the actions of
other subprocedures. When a subprocedure calls another subprocedure, the callers
environment remains in place. The operating system saves the location in the caller to
which control is to return when the called subprocedure terminates.
Private Data Area
Each activation of a procedure or subprocedure has its own data area. Upon
termination, each activation relinquishes its private data area, thereby minimizing the
amount of memory that the program uses.