162. EXIT can be used to leave a named outer loop.#

topic: Loops

Note

This tip is a draft1.

Loops can be labeled with syntax

name1: do i=1,n name2: do j=1,n … end do name2 end do name1

EXIT leaves the inner loop. EXIT <name> can be used to leave an outer loop. A loop label also clarifies what loop is terminated by END DO.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.