TAL Reference Manual
Procedures
TAL Reference Manual—526371-001
13-7
VARIABLE
VARIABLE
The VARIABLE attribute means the compiler treats all parameters of the procedure (or
subprocedure) as if they are optional, even if some are required by your code. If you
add parameters to the VARIABLE procedure (or subprocedure) declaration, all
procedures that call it must be recompiled. The following example declares a
VARIABLE procedure:
PROC v (a, b) VARIABLE;
INT a, b;
BEGIN
!Lots of code
END;
When you call a VARIABLE procedure (or subprocedure), the compiler allocates space
in the parameter area for all the parameters. The compiler also generates a parameter
mask, which indicates which parameters are actually passed. The
TAL Programmer’s
Guide describes parameter allocation, parameter masks, and testing for the presence
of actual parameters.
EXTENSIBLE
The EXTENSIBLE attribute lets you add new parameters to the procedure declaration
without recompiling its callers. The compiler treats all parameters of the procedure as if
they are optional, even if some are required by your code. The following example
declares an EXTENSIBLE procedure:
PROC x (a, b) EXTENSIBLE;
INT a, b;
BEGIN
!Do some work
END;
When you call an EXTENSIBLE procedure, the compiler allocates space in the
parameter area for all the parameters. The compiler also generates a parameter mask,
which indicates which parameters are actually passed. The
TAL Programmer’s Guide
describes parameter allocation, parameter masks, and testing for presence of actual
parameters.
Count Option
You use the count option following the EXTENSIBLE attribute only when you convert a
VARIABLE procedure to an EXTENSIBLE procedure. The
count value is the number of
formal parameters in the VARIABLE procedure that you are converting to
EXTENSIBLE. For the
count value, specify an INT value in the range 1 through 15. For
more information on VARIABLE-to-EXTENSIBLE conversions, see Section 11, Using
Procedures, in the
TAL Programmer’s Guide.