www.delorie.com/gnu/docs/gcc/g77_539.html   search  
Buy the book!

Using and Porting GNU Fortran

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.11 Alternate Returns (SUBROUTINE and RETURN)

Subroutines with alternate returns (e.g. `SUBROUTINE X(*)' and `CALL X(*50)') are implemented by g77 as functions returning the C int type. The actual alternate-return arguments are omitted from the calling sequence. Instead, the caller uses the return value to do a rough equivalent of the Fortran computed-GOTO statement, as in `GOTO (50), X()' in the example above (where `X' is quietly declared as an INTEGER(KIND=1) function), and the callee just returns whatever integer is specified in the RETURN statement for the subroutine For example, `RETURN 1' is implemented as `X = 1' followed by `RETURN' in C, and `RETURN' by itself is `X = 0' and `RETURN').

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003