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>Language</strong> <strong>Reference</strong><br />

8.3 Logical Assignment<br />

The form of a logical assignment statement is<br />

<br />

v = e<br />

where:<br />

v<br />

e<br />

is a variable name or array element name of type LOGICAL.<br />

is a logical expression.<br />

The following are examples of logical assignment statements.<br />

LOG1 = .TRUE.<br />

LOG2 = (X.GT.Y) .AND. (X.LT.Z)<br />

LOG3(2) = LOG2 .EQV. LOG1<br />

Executing a logical assignment statement causes the evaluation of the logical expression e, and defining v<br />

with the result. Note that the type of v and e must be LOGICAL.<br />

8.4 Statement Label Assignment<br />

The form of a statement label assignment is<br />

<br />

ASSIGN s to i<br />

where:<br />

s<br />

i<br />

is a statement label.<br />

is the name of an integer variable.<br />

The following is an example of a statement label assignment statement.<br />

ASSIGN 10 TO I<br />

The result of executing an ASSIGN statement causes the integer variable i to be defined with the value of<br />

the statement label s. s must be the statement label of an executable statement or a format statement in<br />

the same program unit in which the ASSIGN statement appears. It is possible to change the value of i by<br />

executing another ASSIGN statement.<br />

During execution when i is used in an assigned GO TO statement, an ASSIGN statement which defines i<br />

must have been executed prior to the execution of the assigned GO TO statement.<br />

188 Statement Label Assignment

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

Saved successfully!

Ooh no, something went wrong!