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 />

IF (logical)<br />

IF (logical)<br />

Conditionally executes a statement.<br />

Syntax<br />

IF (logical-expression) statement<br />

logical-expression<br />

statement<br />

Description<br />

336<br />

is a logical expression.<br />

is any executable statement other than the following:<br />

A statement used to begin a construct<br />

Any END statement<br />

Any IF statement<br />

The logical IF statement is a two-way decision maker. If logical-expression evaluates to is<br />

true, statement executes and control passes to the next statement. If logical-expression<br />

evaluates to false, statement does not execute and control passes to the next statement in the<br />

program.<br />

Examples<br />

IF (a .EQ. b) PRINT *, 'They are equal.'<br />

Related statements<br />

IF (arithmetic) and IF (construct)<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!