skip to main content

Procedure Division : Conformance for parameters and returning items : Parameters : Elementary items passed by reference

Elementary items passed by reference
If either the formal parameter or the corresponding argument is an object reference, the corresponding argument or formal parameter shall be an object reference following these rules:
1.
2.
3.
If either the argument or the formal parameter is of class pointer, the corresponding formal parameter or argument shall be of class pointer and the corresponding items shall be of the same category. If either is a restricted pointer, both shall be restricted and of the same type.
If neither the formal parameter nor the argument is of class object or pointer, the conformance rules are the following:
1.
If the activated element is a program for which there is no program-specifier in the REPOSITORY paragraph of the activating element and there is no NESTED phrase specified on the CALL Statement, the formal parameter shall be of the same length as the corresponding argument.
2.
If the activated element is a method, then the definition of the formal parameter and the definition of the argument shall have the same BLANK WHEN ZERO, JUSTIFIED, PICTURE, USAGE, and SIGN clauses, with the following exceptions:
a.
b.
Period picture symbols match if and only if the DECIMAL-POINT IS COMMA clause is in effect for both the activating and the activated runtime elements or for neither of them. Comma picture symbols match if and only if the DECIMAL-POINT IS COMMA clause is in effect for both the activating and the activated runtime elements or for neither of them.
Additionally:
a.
b.
If the formal parameter is described with the ANY LENGTH clause, its length is considered to match the length of the corresponding argument.
c.
If the argument is described with the ANY LENGTH clause, the corresponding formal parameter shall be described with the ANY LENGTH clause.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left