Path: utzoo!attcan!uunet!lll-winken!ames!hc!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: DO loops, anyone? Message-ID: <10620@lanl.gov> Date: 17 Mar 89 23:00:26 GMT References: <6676@ecsvax.UUCP> Organization: Los Alamos National Laboratory Lines: 25 From article <6676@ecsvax.UUCP>, by urjlew@ecsvax.UUCP (Rostyk Lewyckyj): > [...] > Pro1 Prohibit gotbranches into the scope of a DO loop, whether to a statement > well inside the loop or the terminal statement. CThExcept to the DO state- > ment itsleelf from a statement outside the DO. > 2 Prohibit the extended range of the DO. i.e. branching out of the DO > and then back in. > 3 Require a each DO loop to be terminated by its own ENDDO, which can not > be the target of a branch. Your first and second prohibitions are already in the Fortran 77 standard. ANSI: 11.10.8 Transfer into the Range of a DO-Loop. Transfer of control into the range of a DO-loop from outside the range is not permitted. ANSI: 11.10.1 Range of a DO-Loop. The range of a DO-loop consists of all of the executable statements that appear following the DO statement that specifies the Do-loop, up to and including the terminal statement of the DO-loop. These two rules prohibit 'extended range' as well as branches into the loop - including the terminal statement. J. Giles