Transfers control to a variable that was assigned a label.
Syntax
GO TO integer-variable [[,] (label-list)] |
- integer-variable
is a scalar variable of default type integer.
- label-list
is a list of statement labels, separated by commas.
Description
The assigned GO TO statement transfers control to the statement whose
label was most recently assigned to a variable with the ASSIGN statement.
integer-variable must be given a label value of an executable statement
through an ASSIGN statement prior to execution of the GO TO statement. When the assigned GO TO statement is executed, control is transferred
to the statement whose label matches the label value of integer-variable.
label-list is a list of labels that integer-variable might assume.
integer-variable must not be an array element or an integer component
of a derived type.
The use of this statement can hinder the ability of the compiler
to optimize the program in which it occurs.
Examples
ASSIGN 10 TO out GO TO out |
Related statements
ASSIGN, GO TO (computed), and GO TO (unconditional)
Related concepts
For information about flow control statements, see “Flow
control statements”.