



Arguments of External Procedures The rules for argument association are the same for both forms of external
procedure. The list of dummy arguments (sometimes called formal arguments) of an
external procedure is specified in its FUNCTION or SUBROUTINE statement. There can
be any number of arguments, including none at all. If there are no arguments then
the parentheses can be omitted in the CALL and SUBROUTINE statement but not in a
FUNCTION statement or function reference.
The dummy argument list is simply a list of symbolic names which can represent any mixture of
Dummy variables, arrays, and procedures are distinguished only by the way that
they are used within the procedure. The dimension bounds of a dummy arrays
must be specified in a subsequent type or DIMENSION statement; dummy
procedures must appear in a CALL or EXTERNAL statement or be used in
a function reference; anything else is, by elimination, a dummy argument
variable.
Dummy argument variables and arrays can be used in executable statements in
just the same way as local items of the same form, but they cannot appear in SAVE,
COMMON, DATA, or EQUIVALENCE statements.
The actual arguments of the function reference or CALL statement become
associated with the corresponding dummy arguments of the FUNCTION or SUBROUTINE
statement. The main rules are as follows:
The same actual argument cannot be used more than once in a procedure call if the corresponding dummy arguments are assigned new values. For example, with:
SUBROUTINE FUNNY(X, Y) X = 2.0 Y = 3.0 END |
CALL FUNNY(A, A)
would be illegal because the system would try to assign both 2.0 and 3.0 to the
variable A.
A similar restriction applies to variables which are returned via a common block and also through the procedure argument list.