XL Fortran for AIX 8.1

Language Reference

GO TO (Assigned)


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


>>-GO TO--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.

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.


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------------------------------+


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

Related Information

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