TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-10
Usage Considerations
Usage Considerations
To invoke procedures and subprocedures (but usually not functions), use the CALL
statement.
To invoke functions, you usually use their identifiers in expressions. If you invoke a
function by using a CALL statement, the caller ignores the returned value of the
function.
Actual parameters are value or reference parameters and are optional or required
depending on the formal parameter specification in the called procedure or
subprocedure declaration (described in Section 13, Procedures
). A value parameter
passes the content of a location; a reference parameter passes the address of a
location.
The CALL keyword in CALL statements is optional. In a CALL statement to a
VARIABLE procedure or subprocedure or to an EXTENSIBLE procedure, you can omit
optional parameters in two ways:
You can omit parameters or parameter pairs unconditionally. Use an empty comma
for each omitted parameter or parameter pair up to the last specified parameter or
parameter pair. If you omit all parameters, you can specify an empty parameter list
(parentheses with no commas) or you can omit the parameter list altogether.
You can omit parameters or parameter pairs conditionally. Use the $OPTIONAL
standard function as described in Section 14, Standard Functions
.
After the called procedure or subprocedure completes execution, control returns to the
statement following the CALL statement that invoked the procedure or subprocedure.
For more information on parameters and parameter pairs, see the
TAL Programmers
Guide.
Examples of CALL Statements
1. This example invokes procedure ERROR_HANDLER, which has no formal
parameters:
CALL error_handler;
2. This example omits the CALL keyword from the CALL statement:
error_handler;
3. This example includes all parameters:
CALL compute_tax (item, rate, result);