Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Fortran 90 Programmer's Reference > Chapter 10 HP Fortran 90 statements

IF (arithmetic)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Transfers control to one of three labels.

Syntax

IF (arithmetic-expression) labelN, labelZ, labelP
arithmetic-expression

is an arithmetic expression of any numeric type except complex and double complex.

label

is a label of an executable statement.

Description

The arithmetic IF statement transfers control to the statement whose label is determined by arithmetic-expression. If arithmetic-expression evaluates to a negative value, control transfers to labelN; if it evaluates to 0, control transfers to labelZ; and if it evaluates to a positive value, control transfers to labelP.

The same label may appear more than once in the same arithmetic IF statement.

Each label must be that of an executable statement in the same scoping unit as the arithmetic IF.

Examples

i = -1
! Branch to statement labeled 10
IF (i) 10, 20, 30

Related statements

IF (construct) and IF (logical)

Related concepts

For information about flow control statements, see “Flow control statements”.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.