CALL/'subprogram name'[,actual argument list]
Transfers control of program execution to a subprogram. Variables and arguments from the main program can be passed to the subroutine as it is being called. Values calculated in the subroutine, can in turn, be passed back when the subroutine returns to the main program.
Parameter |
Description |
'subprogram name' |
The name of the subprogram to be executed. The name used must be a string literal in single quotes, string variables are not allowed.
|
actual argument list |
A list of up to 25 values which may be any combination of numbers, objects, strings, or variables. A variable may be either a simple variable or an array of which all or only a portion may be passed to the the subprogram. Passing only a portion of an array involves the use of the subrange operator as follows:
|
An alternative to using the subrange operator in a CALL statement is to pass the entire array and the subrange bounds as two additional arguments. However, whether a single value, an array or a portion of an array is passed in the argument list the corresponding dummy arguments in the subprogram must agree in type, quantity and order.