Download HP Pascal for OpenVMS User Manual
Transcript
• Modify—a parameter specifies data that is both read and written by the called routine. In this case, the called routine reads the input data, which it uses in its operations, and then overwrites the input data with the results. Thus, when the called routine completes execution, the input data specified by the argument is lost. Table 6–2 lists all access methods that may appear under the access entry in a parameter description, as well as the HP Pascal translation. Table 6–2 Access Type Translations Access Entry Method Used in HP Pascal Call after stack unwind Procedure or function parameter passed by immediate value Function call (before return) Function parameter Jump after unwind Not available Modify Variable semantics1 Read only Value or foreign semantics Call without stack unwind Procedure parameter Write only Variable semantics1 1 It is possible to obtain variable semantics by either specifying the VAR keyword on the formal parameter or by passing a variable as an actual parameter using %REF, %DESCR, or %STDESCR. 6.2.3 Methods Used to Obtain Passing Mechanisms The way in which an argument specifies the actual data to be used by the called routine is defined in terms of the parameter-passing mechanism. Table 6–3 lists all passing mechanisms that may appear under the mechanism entry in an argument description and the method used in HP Pascal to obtain the passing mechanism. Table 6–3 Mechanism Type Translations Mechanism Entry Method Used in HP Pascal By value %IMMED or [IMMEDIATE] By reference VAR, %REF or [REFERENCE] or default (continued on next page) Programming on OpenVMS Systems 6–7