Assigns statement label to integer variable.
Syntax
ASSIGN stmt-label TO integer-variable |
- stmt-label
is the statement label for an executable statement
or a FORMAT statement
in the same scoping unit as the ASSIGN
statement.
- integer-variable
is a scalar variable of the default integer type.
It cannot be a field of a derived type or record, or an array element.
Description
Once a variable is defined by an ASSIGN
statement, it can be used in an assigned GO TO
statement or as a format specifier in an input/output statement.
It should not be used in any other way.
A variable that has been assigned a statement label can be
reassigned another label or an integer value. If integer-variable
is subsequently assigned an integer value, it no longer refers to
a label.
Examples
ASSIGN 20 TO last1 GO TO last1 ... ! ASSIGN used with FORMAT statement ASSIGN 10 TO form1 10 FORMAT(F6.1,2X,I5/F6.1 READ(5,form1)sum,k1,ave1 20 ... |
Related statements
GO TO (assigned)
Related concepts
For related information, see the following: