ASSIGN statement

Standard: F77 F90 F95 F2003 F2008 Example program


ASSIGN label TO variable


Assigns a label to an integer variable. This does not define the integer as a variable and it must not be referenced or copied. If the label is that of a FORMAT statement, it may be used in place of a label in an input/output statement. Otherwise, it must be the label of a valid branch target statement, and may be used in an assigned GOTO statement.

This statement was deleted from the Fortran 95 standard as it was considered too error-prone and hard to understand. Computed GOTO statements, SELECT CASE statements, and character string format specifiers should be used instead.

It remains deleted in Fortran 2003 and 2008, though all compilers still accept it as an extension.


CASE construct, GO TO statement, FORMAT statement