Placement of Procedure Reference Arrays

A procedure reference array is an array of references to procedures of identical type and parameters. An element of a procedure reference array can appear in the following places:

  • On either side of a procedure reference array assignment

  • As a primary in an expression, if the procedure reference array has a type associated with it

  • In a PROCEDURE REFERENCE ARRAY statement

  • As a formal or actual parameter

  • As an object exported by, or imported from, a library in a LIBRARY declaration

For more information, see LIBRARY Declaration earlier in this section.

Before an element of a procedure reference array can be used as a parameter, as a primary, or in a PROCEDURE REFERENCE ARRAY statement, it must be initialized in a procedure reference array assignment. A procedure assigned to the element must have had its parameters declared explicitly.

A procedure reference array can appear in the formal parameter part of a PROCEDURE declaration or of another PROCEDURE REFERENCE ARRAY declaration. A formal parameter that is a procedure reference array must be declared FORMAL so that all of its parameters are checked at compilation time.

A procedure reference array element can be passed as an actual parameter to a formal procedure that is of the same type and that has the same parameter descriptions.

A local PROCEDURE REFERENCE ARRAY declaration cannot appear in the global part of a program unit. A global PROCEDURE REFERENCE ARRAY declaration can appear in the global part of a program unit or in a LIBRARY declaration.