Re: dumb question #1 re: DO loops
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Thu, 29 Dec 2005 11:30:38 -0800
*** Russell <richard.russell@xxxxxxxxxxx> wrote:
> You have it right. In current Fortran, an exit from the loop would be:
> IF(ID(J).LT.0) EXIT
And while it isn't directly relevant to the OP's current task, let me
just note that the corresponding "current" way to continue the loop is
if (id(j)<0) cycle
or, even better, in my personal opinion,
if (id(j)<0) cycle the_do_loop
where the_do_loop is some suitably descriptive name given to the loop.
My personal style is to always use a label with cycle or exit statements
in order to make it explicit and clear what is being cycled or exited.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- References:
- dumb question #1 re: DO loops
- From: StevO
- Re: dumb question #1 re: DO loops
- From: *** Russell
- dumb question #1 re: DO loops
- Prev by Date: Re: dumb question #1 re: DO loops
- Next by Date: Re: Serial port programming with G95
- Previous by thread: Re: dumb question #1 re: DO loops
- Index(es):