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 Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 10 HP Fortran statements

EXIT

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Terminates a DO loop.

Syntax

EXIT [do-construct-name]
do-construct-name

is the name given to the DO construct. If do-construct-name is specified, it must be the name of a DO construct that contains the EXIT statement.

Description

If you do not specify do-construct-name, the EXIT statement terminates the immediately enclosing DO loop. If you do specify it, the EXIT statement terminates the enclosing DO loop with the same name.

Examples

DO i = 1, 20
n(i) = 0
READ *, j
IF (j < 0) EXIT
n(i) = j
END DO

Related statements

CYCLE and DO

Related concepts

For related information, see the following:

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