next up previous contents
Next: Local Objects Up: Program Units Previous: Functions

 

Argument Association

Recall, in the SUBROUTINE example we had an invocation:

      CALL OutputFigures(NumberSet)
and a declaration,
      SUBROUTINE OutputFigures(Numbers)

An argument at a call site (in an invocation), for example, NumberSet, is called an actual argument as it is the true name of the variable, and an argument in a procedure declaration is a dummy argument, for example, Numbers as it is a substitute for the true name. A reference to a dummy argument is really a reference to its corresponding actual argument, for example, changing the value of a dummy argument actually changes the value of the actual argument. Dummys and actuals are said to be argument associated. Procedures may have any number of such arguments but actuals and dummys must correspond in number, type, kind and rank. [FORTRAN 77\ programs which flouted this requirement were not standard conforming but there was no way for the compiler to check.]

For the above call, Numbers is the dummy argument and NumberSet is the actual argument.

Consider,

      PRINT*, F(a,b)

and

      REAL FUNCTION F(x,y)

here, the actual arguments a and b are associated with the dummy arguments x and y.

If the value of a dummy argument changes then so does the value of the actual argument.

Return to corresponding overview page gif


next up previous contents
Next: Local Objects Up: Program Units Previous: Functions

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.