TAL Programmer's Guide

CALL Statement
Controlling Program Flow
096254 Tandem Computers Incorporated 12–19
CALL Statement You use the CALL statement to call a procedure, subprocedure, or entry-point
identifier, and optionally pass parameters to it.
To specify a CALL statement, you can include:
CALL identifier
Specifies the identifier of a procedure, subprocedure, or entry-point identifier. As
of the D20 release, the CALL keyword is optional.
parameter-list
Specifies an optional list, enclosed in parentheses, of one or more comma-
separated actual parameters that you want to pass to the called procedure or
subprocedure. The actual parameters in the list must correspond to the formal
parameters of the called procedure or subprocedure.
Calling Procedures
and Subprocedures
To call a procedure or subprocedure that has no formal parameters, simply include the
identifier of the procedure or subprocedure in the CALL statement:
CALL error_handler;
When a called procedure or subprocedure finishes executing, control returns to the
statement following the CALL statement that invoked the procedure or subprocedure.
To call a procedure or subprocedure that has formal parameters, include the identifier
of the procedure or subprocedure and a list of actual parameters in the CALL
statement:
CALL compute_tax (item, rate, result);
For VARIABLE or EXTENSIBLE procedures, some or all of the formal parameters are
optional. When you call such a procedure, you can omit some or all of the optional
parameters:
Omitting Parameters Unconditionally
To omit some of the parameters or parameter pairs, use a place-holding comma for
each omitted parameter or parameter pair up to the last specified parameter or
parameter pair. Here are examples of omitted parameters:
CALL extensible_proc (num, , char, , , eof);
CALL extensible_proc ( , , , , , x);
To omit all parameters, you can specify an empty parameter list or you can omit the
parameter list altogether:
CALL extensible_proc ( );
CALL extensible_proc;
In addition to place-holding commas, you can include comments to keep track of
omitted parameters:
CALL extensible_proc (num, !name!, char, !val!, !size!, eof);