|
If I was really programming an endless loop, I wouldn't be doing my job was I? Every loop you program is basically an endless loop, regardless how you program the DO-statement. If you don't meet the condition that tells it to end, it runs on forever. I prefer this method (I'd rather have just a 'Do' instead of 'Do *Hival', but Hans didn't give as this option), because I like to leave my do-loop right after I meet a condition that makes me leave the loop (like EOF). I think that is the most obvious place to do this. To me it is not obvious to set an indicator and later test this indicator to see whether I should leave the loop. You never know what happens to this indicator between the moment it is set and the moment it is tested. I can't see how anyone can object against using Leave and Iter. With goto's you can (you don't don't have to) program spaghetti-code. Not with Leave or Iter!! BTW. I used to use dow 1=1, but that raised more eyebrows than Do *Hival. Everybody I know immediately understood the meaning of it. Wilbert I was afraid I might be starting a holy war ;) ----- Original Message ----- From: "Joel Cochran" <jrc@xxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Friday, November 21, 2003 6:23 PM Subject: Re: Infinit loop in /free > LOL, I guess there's always at least one exception! > > Joel > http://www.rpgnext.com > > > On Fri, 2003-11-21 at 21:57, Peter Dow wrote: > > Hi Joel, > > > > Reminds me of a class I took 30+ years ago where the instructor brought up > > that same question ("I too must question the logic of coding an endless > > loop") and answered it with another question "Under what circumstances would > > you want a program controlling a heart-lung machine to end?" > > > > Regards, > > Peter Dow > > Dow Software Services, Inc. > > 909 793-9050 voice > > 909 793-4480 fax > > 909 522-3214 cell > > > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.542 / Virus Database: 336 - Release Date: 11/20/2003 > > > > > > _______________________________________________ > > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > > To post a message email: RPG400-L@xxxxxxxxxxxx > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > > or email: RPG400-L-request@xxxxxxxxxxxx > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/rpg400-l. > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.