Lahey/Fujitsu Fortran

CYCLE Statement


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


CYCLE [do-const-name]

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


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.


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