24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>FORTRAN</strong> Statements<br />

It should be noted that the ASSIGN statement does not assign the numeric value of the statement label to<br />

the variable.<br />

Example:<br />

ASSIGN 100 TO LABEL2<br />

PRINT *, LABEL2<br />

Try the above example; the value printed will not be 100.<br />

Consider the following example.<br />

Example:<br />

* Illegal use of a GOTO statement.<br />

LABEL2 = 123<br />

LABEL3 = LABEL2 + 10<br />

GO TO LABEL3<br />

LABEL3 is assigned the integer value 133. The assigned GO TO statement, which follows it, is illegal and<br />

a run-time error will occur when it is executed.<br />

Statement label values are quite different from integer values and the two should never be mixed. In the<br />

following example, the assignment statement is illegal since it involves an integer variable that was<br />

specified in an ASSIGN statement.<br />

Example:<br />

* Illegal use of an ASSIGNed variable in an expression.<br />

ASSIGN 100 TO LABEL2<br />

LABEL3 = LABEL2 + 10<br />

Note that if the assignment statement was preceded by<br />

LABEL2 = 100<br />

the assignment statement would have been legal.<br />

Statement Label Assignment (ASSIGN) Statement 17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!