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

2.68 QUIT Statement<br />

QUIT<br />

[: block-label]<br />

The QUIT statement may be used to cause a transfer of control to the first executable statement that follows<br />

the terminal statement of the block which contains it. Examples of such terminal statements are ADMIT,<br />

CASE, END DO, END LOOP, END WHILE, UNTIL, etc. If block-label is present then control is<br />

transferred out of the block identified by that block label. The QUIT statement is an extension to the<br />

<strong>FORTRAN</strong> <strong>77</strong> language.<br />

Example:<br />

LOOP<br />

WRITE( UNIT=*, FMT=’(A)’ ) ’Enter a number’<br />

READ( UNIT=*, FMT=’(F10.4)’, IOSTAT=IOS ) X<br />

IF( IOS .NE. 0 ) QUIT<br />

IF( X .LT. 0 ) QUIT<br />

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

END LOOP<br />

END<br />

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

122 QUIT Statement

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

Saved successfully!

Ooh no, something went wrong!