1. Home
  2. CALLS directive

CALLS directive

Lists library procedures called by a procedure.

No options

Parameter

    identifiers Names of the called procedures

Description

CALLS is useful when you are building a suite of procedures. By default, when you define a procedure, Genstat checks that any procedures that it calls are available in the program or in an attached procedure library. However, this can create problems when procedures call each other. For example, Genstat is happy to execute programs where a procedure, A say, calls other procedures that themselves call procedure A. However, it is then impossible to decide on an order in which to define the procedures.

Before CALLS became available, the solution was to define dummy procedures (with option and parameter definitions but no executable statements) before any of the real procedures were defined. A better solution now, though, is to specify a CALLS statement in each procedure, to list the procedure that it calls. Genstat then regards these as a set of “trusted” sub-procedures, that it assumes will be provided before the procedure is executed. (If not, you will get a fault diagnostic then!)

The CALLS statement must come immediately after the option and parameter definitions (using the OPTION and PARAMETER directives), and before any executable statements. It has a single parameter, that lists the names of the procedures that are called.

Options: none.

Parameter: unnamed.

See also

Directives: PROCEDURE, OPTION, PARAMETER, ENDPROCEDURE.

Commands for: Program control.

Updated on March 8, 2019

Was this article helpful?