02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's 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>HP</strong> <strong>Fortran</strong> statements<br />

GO TO (computed)<br />

GO TO (computed)<br />

Transfers control to one of several labels.<br />

Syntax<br />

GO TO ( label-list ) [,] arithmetic-expression<br />

label-list<br />

arithmetic-expression<br />

Description<br />

332<br />

is a list of statement labels, separated by commas.<br />

is a scalar integer expression. As an extension, <strong>HP</strong> <strong>Fortran</strong> also allows the<br />

expression to be of type real or double precision.<br />

The computed GO TO statement transfers control to one of several labeled statements,<br />

depending on the value of arithmetic-expression. Afterarithmetic-expression is<br />

evaluated (and, if necessary, truncated to an integer value), control transfers to the statement<br />

label whose position in label-list corresponds to the truncated value of<br />

arithmetic-expression.<br />

If the value of arithmetic-expression is less than 1 or greater than the total number of<br />

labels in label-list, control transfers to the executable statement immediately following the<br />

computed GO TO statement.<br />

Examples<br />

index = 3<br />

! Branch made to the statement labeled 30.<br />

GO TO (10, 20, 30, 40) index<br />

Related statements<br />

SELECT CASE, GO TO (assigned), and GO TO (unconditional)<br />

Related concepts<br />

For information about flow control statements, see “Flow control statements” on page 113.<br />

Chapter 10

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

Saved successfully!

Ooh no, something went wrong!