next up previous contents
Next: Branching to an END Up: Obsolescent Features Previous: Shared DO-loop Termination

Alternate RETURN

This allows a calling program unit to specify labels as arguments to a called procedure as shown. The called procedure can then return control to different points in the calling program unit by specifying an integer parameter to the RETURN statement which corresponds to a set of labels specified in the argument list.

     ...
    CALL SUB1(x,y,*98,*99)
     ...
 98 CONTINUE
     ...
 99 CONTINUE
     ...

     SUBROUTINE SUB1(X,Y,*,*)
     ...
     RETURN 1
     ...
     RETURN 2
     END

Use an INTEGER return code and a GOTO statement or some equivalent control structure.


next up previous contents
Next: Branching to an END Up: Obsolescent Features Previous: Shared DO-loop Termination

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