LF Fortran 95

CYCLE Statement

Description

The CYCLE statement skips to the next iteration of a DO loop.

Syntax

CYCLE [do-const-name]
Where:

do-const-name is the name of a DO construct that contains the CYCLE statement.

Remarks

The CYCLE statement may only appear within a DO construct.

If do-const-name is omitted, it is as if do-const-name were the name of the innermost DO construct in which the CYCLE statement appears.

Example

integer :: i, j outer: do i=1, 10 if(i < 3) cycle ! cycles outer inner: do j=1, 10 if (i < j) cycle ! cycles inner if (i > j) cycle outer ! cycles to outer end do inner end do outer

See Also

EXIT Statement

DO construct