FORTRAN 77 Language Reference


If a statement function is referenced, the defined calculations are inserted.

Example: The following statement is a statement function:

       ROOT( A, B, C ) = (-B + SQRT(B**2-4.0*A*C))/(2.0*A) 

The statement function argument list indicates the order, number, and type of arguments for the statement function.

A statement function is referenced by using its name, along with its arguments, as an operand in an expression.

Execution proceeds as follows:

  1. If they are expressions, actual arguments are evaluated.

  2. Actual arguments are associated with corresponding dummy arguments.

  3. The expression e, the body of a statement function, is evaluated.

  4. If the type of the above result is different from the type of the function name, then the result is converted.

  5. Return the value.

The resulting value is thus available to the expression that referenced the function.