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.76 SELECT Statement<br />

SELECT [CASE] (e) [FROM] [: block-label]<br />

The SELECT statement is used in conjunction with the CASE and END SELECT statements. The form of<br />

a SELECT block is as follows:<br />

where:<br />

SELECT [CASE] (e) [FROM] [: block-label]<br />

CASE ( case-list )<br />

statement (s)<br />

CASE ( case-list )<br />

statement (s)<br />

.<br />

.<br />

.<br />

CASE ( case-list )<br />

statement(s)<br />

CASE DEFAULT<br />

statement(s)<br />

END SELECT<br />

e<br />

case-list<br />

is an integer expression.<br />

is a list of one or more cases separated by commas. A case is either<br />

(a)<br />

(b)<br />

a single integer, logical or character constant expression or<br />

an integer, logical or character constant expression followed by a colon<br />

followed by another expression or the same type. This form of a case<br />

defines a range of values consisting of all integers or characters greater<br />

than or equal to the value of the expression preceding the colon and less<br />

than or equal to the value of the expression following the colon.<br />

The CASE and FROM keywords are optional in the SELECT statement. An optional block label may be<br />

specified with the SELECT statement.<br />

The case expression e is evaluated and if the result is equal to one of the values covered by case-list<br />

then the control of execution is transferred to the associated CASE block.<br />

SELECT Statement 137

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

Saved successfully!

Ooh no, something went wrong!