XL Fortran for AIX 8.1

Language Reference

GO TO (Assigned)

Purpose

The assigned GO TO statement transfers program control to an executable statement, whose statement label is designated in an ASSIGN statement.

Format



>>-GO TO--variable_name--+------------------------------+------><
                         '-+---+--(--stmt_label_list--)-'
                           '-,-'
 
 

variable_name
is a scalar variable name of type INTEGER(4) or INTEGER(8) that you have assigned a statement label to in an ASSIGN statement.

stmt_label
is the statement label of an executable statement in the same scoping unit as the assigned GO TO. The same statement label can appear more than once in stmt_label_list.

Rules

When the assigned GO TO statement is executed, the variable you specify by variable_name with the value of a statement label must be defined. You must establish this definition with an ASSIGN statement in the same scoping unit as the assigned GO TO statement. If the integer variable is a dummy argument in a subprogram, you must assign it a statement label in the subprogram in order to use it in an assigned GO TO in that subprogram. Execution of the assigned GO TO statement transfers control to the statement identified by that statement label.

If stmt_label_list is present, the statement label assigned to the variable specified by variable_name must be one of the statement labels in the list.

The assigned GO TO cannot be the terminal statement of a DO or DO WHILE construct.

+---------------------------------Fortran 95---------------------------------+

The assigned GO TO statement has been deleted in Fortran 95.

+-----------------------------End of Fortran 95------------------------------+

Examples

      INTEGER RETURN_LABEL
         
  ·
  ·
  ·
! Simulate a call to a local procedure ASSIGN 100 TO RETURN_LABEL GOTO 9000 100 CONTINUE
  ·
  ·
  ·
9000 CONTINUE ! A "local" procedure
  ·
  ·
  ·
GOTO RETURN_LABEL

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]