HP 3000 Manuals

ASSIGN Statement (Executable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

ASSIGN Statement (Executable) 

The ASSIGN statement assigns a statement label to an INTEGER*4 variable.

	       Click here to view figure.
            

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|       Item        |        Description/Default         |            Restrictions            |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| label             | Statement label.                   | Must be the label of an executable |
|                   |                                    | statement or a FORMAT statement.   |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| variable          | INTEGER*4 simple variable.         | None.                              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

Semantics 

The variable defined as a label by the ASSIGN statement can subsequently
be used in an assigned GOTO statement or as the format specifier in an
input/output statement.

A variable must be defined with a statement label value in order to be
referenced in an assigned GOTO statement or be used as a format
identifier in an input/output statement.  While defined with a statement
label value, the variable must not be referenced in any other way; that
is, it should not be redefined with an assignment statement or used as a
variable in an expression.  Also, the variable cannot be passed to a
subroutine or function and used within that program unit.

An integer variable defined with a statement label value can be redefined
with the same or a different statement label value or an integer value.

                 Examples                                      Notes 

---------------------------------------------------------------------------------------

ASSIGN 10 TO label1                         Assigns the statement label 10 to the
                                            variable label1.

ASSIGN 20 TO last1                          Assigns the statement label 20 to the
:                                           variable last1.  The label is that of an
GOTO last1                                  executable statement.

ASSIGN 100 TO form1                         Assigns the statement label 100 to the
:                                           variable form1.  The label is that of a
100 FORMAT (F6.1,2X,I5/F6.1)                FORMAT statement.
:
READ (5,form1) sum, ki, ave1



MPE/iX 5.0 Documentation