VMS Help
FORTRAN, Statements, GOTO

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

  Transfers control within a program unit.  Depending upon the value
  of an expression, control is transferred either to the same
  statement every time GO TO is executed or to one of a set of
  statements.

  1 - Unconditional

  Transfers control unconditionally to the same statement every time
  the GO TO is executed.  Statement format:

     GO TO s

     s  Is the label of an executable statement that is
        in the same program unit as the GO TO statement.

  2 - Computed

  Transfers control to a statement based upon the value of an
  expression within the statement.  Statement format:

    GO TO (slist)[,]e

     slist  Is a list of one or more labels of executable
            statements separated by commas. The list of labels
            is called the transfer list.

     e      Is an integer arithmetic expression in the range
            1 to n (where "n" is the number of statement labels
            in the transfer list).

  If the value of e is less than one or greater than the number of
  labels in the transfer list, control is transferred to the first
  executable statement after the computed GO TO.

  3 - Assigned

  Transfers control to a statement label that is represented by a
  variable.  An ASSIGN statement must establish a relationship
  between the variable and the specified statement label.  Statement
  format:

     GO TO v[[,](slist)]

     v      Is an integer variable whose value was set by a
            preceding ASSIGN statement in the same program unit.
            (In Compaq Fortran, v must be INTEGER*4.)

     slist  Is a list of one or more labels of executable
            statements separated by commas.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.