Download HP Pascal for OpenVMS User Manual
Transcript
With this declaration, it is possible to specify values for Resultant_String and Prompt_String and truncate the call list at that point. In this case, two parameters would be passed in the CALL instruction. You may want to use a combination of the %IMMED 0 and TRUNCATE methods. This combination would allow you to skip the specification of intermediate optional parameters, as well as allow you to truncate the call list once all desired parameters have been specified. Note that OpenVMS system services require a value to be passed by parameters, including optional parameters; therefore, you should not use the TRUNCATE attribute when defining optional parameters to a system service. Instead, you should specify default values on the formal parameter declaration. The TRUNCATE attribute is useful when calling routines for which the optional parameter is truly optional, for example, when calling run-time library routines. For More Information: • On the TRUNCATE attribute (HP Pascal for OpenVMS Language Reference Manual) 6.2.6 Arbitrary Length Parameter Lists Some run-time library routines require a variable number of parameters. For example, there is no fixed limit on the number of values that can be passed to functions that return the minimum or maximum value from a list of input parameters. The LIST attribute supplied by HP Pascal allows you to indicate the mechanism by which excess actual parameters are to be passed. For example: [ASYNCHRONOUS] FUNCTION MTH$DMIN1 ( D_FLOATING : DOUBLE; EXTRA_PARAMS : [LIST] DOUBLE) : DOUBLE; EXTERNAL; Because the function MTH$DMIN1 returns the D_floating minimum of an arbitrary number of D_floating parameters, the formal parameter EXTRA_ PARAMS is declared with the LIST attribute. All actual parameters must be double-precision real numbers passed by reference with value semantics. For More Information: On the LIST attribute (HP Pascal for OpenVMS Language Reference Manual) 6–12 Programming on OpenVMS Systems