next up previous
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
Next: Branching to an END Up: Obsolescent Features Previous: Shared DO-loop Termination

Adam Marshall ©University of Liverpool, 1996
Wed Oct 9 17:57:29 BST 1996