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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

2.81 UNTIL Statement<br />

UNTIL (e)<br />

where:<br />

e<br />

is a logical expression or integer arithmetic expression, in which case the result of the integer<br />

expression is compared for inequality to the integer value 0.<br />

The UNTIL statement is used in conjunction with the structured LOOP or block WHILE statement. The<br />

LOOP or block WHILE statement marks the beginning of a sequence of statements which are to be repeated.<br />

The UNTIL statement marks the end of the loop. The LOOP-block or WHILE-block is executed until<br />

control is transferred out of the block or the logical expression of the UNTIL statement has a true value.<br />

Example:<br />

Example:<br />

X = 1.0<br />

LOOP<br />

PRINT *, X, SQRT( X )<br />

X = X + 1.0<br />

UNTIL( X .GT. 10.0 )<br />

I = 1<br />

WHILE( I .LT. 100 )DO<br />

J = 4 * I * I<br />

K = 3 * I<br />

PRINT *, ’4x**2 + 3x + 6 = ’, J + K + 6<br />

I = I + 1<br />

UNTIL( ( J + K + 6 ) .GT. 100 )<br />

For more information, see the chapter entitled "Program Structure Control Statements" on page 193.<br />

UNTIL Statement 143

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

Saved successfully!

Ooh no, something went wrong!