TAL Programmer's Guide

Using Procedure Options
Using Procedures
096254 Tandem Computers Incorporated 11–13
A called procedure cannot distinguish between a parameter that is passed
conditionally and one that is passed unconditionally. The execution time is shorter,
however, when you pass or omit a parameter unconditionally.
To make your code portable to future software platforms, use $OPTIONAL for each
optional parameter when calling a VARIABLE or EXTENSIBLE procedure.
Converting VARIABLE
Procedures to
EXTENSIBLE
You can convert a VARIABLE procedure into an EXTENSIBLE procedure. When you
do so, the compiler converts the VARIABLE parameter mask into an EXTENSIBLE
parameter mask. Parameter masks are described later in this section.
Converting a VARIABLE procedure to EXTENSIBLE is the only way to add
parameters to the procedure without recompiling all its callers. You can add new
parameters at the time you convert the procedure or later.
You can convert any VARIABLE procedure that meets the following criteria:
It has at least one parameter.
It has at most 16 words of parameters.
All parameters are one word long except the last, which can be a word or longer.
The size of a formal reference parameter is one word if the address mode is standard;
the size is two words if the address mode is extended.
To convert an existing VARIABLE procedure to EXTENSIBLE, redeclare the procedure
and add the following information:
Any new formal parameters
The keyword EXTENSIBLE
The number of formal parameters in the VARIABLE procedure, specified as an
INT value in the range 1 through 15 and enclosed in parentheses
The following example converts a VARIABLE procedure and adds a new formal
parameter. The value 3 in parentheses specifies that the procedure had three formal
parameters before the procedure was converted from VARIABLE to EXTENSIBLE:
PROC errmsg (msg, count, errnum, new_param) EXTENSIBLE (3);
!Add NEW_PARAM to parameter list
INT .msg;
INT count; !Redeclare existing parameters
INT errnum;
INT new_param; !Declare NEW_PARAM
BEGIN
!Do something
END;