Passing arguments to procedures
When a function or a subroutine is invoked, parameters are associated, from left to right, with the passed arguments.
In general, the following rules apply:
- Computational data arguments can be passed to parameters of any computational data type.
- Program-control data arguments must be passed to parameters of
the same type, with these exceptions.
- Pointer and offset can be passed to each other.
- LIMITED ENTRY can be passed to ENTRY, but ENTRY cannot be passed to LIMITED ENTRY.
- An array of label constants cannot be used as an argument.
Arguments that require aggregate temporaries derived from structures are not allowed, unless the structure argument is declared with constant extents.
Expressions in the argument list are evaluated in the invoking block before the subroutine or function is invoked. A parameter has no storage associated with it. It is merely a means of allowing the invoked procedure to access storage allocated in the invoking procedure.