Purpose
The ASSIGN statement assigns a statement label to an integer variable.
Format
>>-ASSIGN--stmt_label--TO--variable_name----------------------->< |
Rules
A statement containing the designated statement label must appear in the same scoping unit as the ASSIGN statement.
You can redefine an integer variable defined with a statement label value with the same or different statement label value or an integer value. However, you must define the variable with a statement label value before you reference it in an assigned GO TO statement or as a format identifier in an input/output statement.
The value of variable_name is not the integer constant represented by the label itself, and you cannot use it as such.
The ASSIGN statement has been deleted from Fortran 95.
ASSIGN 30 TO LABEL NUM = 40 GO TO LABEL NUM = 50 ! This statement is not executed 30 ASSIGN 1000 TO IFMT PRINT IFMT, NUM ! IFMT is the format specifier 1000 FORMAT(1X,I4) END
Related Information