pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

! Lots of code
END;
When you call a VARIABLE subprocedure, the compiler allocates space in the parameter area
for all the parameters. The value of the data for a missing parameter is unspecified.
EXTENSIBLE
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 values of missing parameters are unspecified.
Declare procedures EXTENSIBLE, but not subprocedures.
count
converts 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.
RETURNSCC
causes a procedure to return a condition code. The compiler reports an error if a procedure
attempts to test the condition code after calling a procedure that does not specify RETURNSCC.
Procedures declared with RETURNSCC cannot return 64-bit values.
NOTE: The EpTAL compiler issues a warning if a procedure that has this attribute returns both
a traditional function value and a condition code value by means of RETURN (page 223). The
reason for this warning is described in Appendix D (page 528).
OVERFLOW_TRAPS
enables overflow traps for a procedure.
NOOVERFLOW_TRAPS
disables overflow traps for a procedure.
LANGUAGE
specifies that the external routine is an HP C, HP COBOL, FORTRAN, or Pascal routine. If you
do not know if the external routine is an HP C, HP COBOL, FORTRAN, or Pascal routine, use
LANGUAGE UNSPECIFIED. The following example shows the LANGUAGE COBOL option
and a public name "a_proc" (in HP COBOL identifier format):
PROC a_proc = "a-proc" (a, b, c) ! EXTERNAL declaration for
LANGUAGE COBOL; ! HP COBOL procedure
STRING .a, .b, .c;
EXTERNAL;
Specify no more than one LANGUAGE attribute in a declaration.
Because no FORTRAN or Pascal compilers exist especially for TNS/R or TNS/E architecture, LANGUAGE FORTRAN
and LANGUAGE PASCAL have no meaning on TNS/R or TNS/E architecture.
If a procedure declaration includes LANGUAGE, it must also include public-name-spec.
Parameters and VARIABLE and EXTENSIBLE Procedures
To determine which parameters were passed by the caller, use the $PARAM (page 336).
250 Procedures, Subprocedures, and Procedure Pointers