24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

12.8.1 Dummy Arguments<br />

Statement function, external functions and subroutines use dummy arguments to define the type of actual<br />

arguments they expect. A dummy argument is one of the following.<br />

Notes:<br />

1. Variable.<br />

2. Array.<br />

3. Dummy procedure.<br />

4. Asterisk (*) indicating a statement label.<br />

1. A statement function dummy argument may only be a variable.<br />

2. An asterisk can only be a dummy argument for a subroutine subprogram.<br />

Dummy arguments that are variables of type INTEGER can be used in dummy array declarators. No<br />

dummy argument may appear in an EQUIVALENCE, DATA, PARAMETER, SAVE, INTRINSIC or<br />

COMMON statement except as a common block name. A dummy argument must not be the same name as<br />

the subprogram name specified in the FUNCTION, SUBROUTINE or ENTRY statement. Other than these<br />

restrictions, dummy arguments can be used in the same way an actual name of the same class would be<br />

used.<br />

12.8.2 Actual Arguments<br />

Actual arguments specify the entities that are to be associated with the dummy arguments when referencing<br />

a subroutine or function. Actual arguments can be any of the following.<br />

Notes:<br />

1. Any expression, except character expression involving the concatenation of an operand whose<br />

length specification is (*) unless the operand is a symbolic constant.<br />

2. An array name.<br />

3. An intrinsic function name.<br />

4. An external function or subroutine name.<br />

5. A dummy procedure name.<br />

6. An alternate return specifier of the form *s where s is a statement number of an executable<br />

statement in the subprogram which contained the CALL statement.<br />

1. A statement function actual argument can only be a variable or an expression.<br />

2. An alternate return specifier can only be an actual argument in the actual argument list of a<br />

subroutine reference.<br />

12.8.3 Association of Actual and Dummy Arguments<br />

When a function or subroutine reference is executed, an association is established between the actual<br />

arguments and the corresponding dummy arguments. The first dummy argument is associated with the first<br />

actual argument, the second dummy argument is associated with the second actual argument, etc.<br />

Association requires that the types of the actual and dummy arguments agree. A subroutine has no type and<br />

when used as an actual argument must be associated with a dummy procedure. An alternate return specifier<br />

278 Subprogram Arguments

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!