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--)-' '-,-' |
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------------------------------+
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