× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: DOU/DOW for READ Loops (My final word)
  • From: "Reger, Bill" <breger@xxxxxxxxxx>
  • Date: Thu, 20 Apr 2000 08:25:12 -0400

Simon, Dan, and anyone else silly enough to want to add to this debate,

I read Simon's reasons for preferring the DOW method and (not surprisingly)
found them well thought out and very clear.  In my opinion this debate is
somewhat silly because different people and different shops tend to have
different standards and preferences.  Therefore those of us who have
occasion to look at other people's code need to recognize both methods and
work with them accordingly.

Personally, in my own code, I tend to prefer the DOU method and let me tell
you my reasons why.  I hope they are as well thought out as Simon's although
that would be a first for me <g>:

1.      I cringe every time I see the same file being read at two different
points in a program.  I like to see an action happening only once and only
at one point in the code.
2.      The second read statement that is coded at the end of the DOW/ENDDO
construct always seems to me to be placed after the code.  I prefer to see
the read statement first, followed by the code that operates on the data
read in.
3.      Using a DOU loop that "always executes at least once" makes sense
because I do want to always read the file at least once.

Anyway, the important thing is to fully understand both methods because we
all will inevitably see both.  Now that I've added myself to this silly
debate, I'll sign off and watch the flames fly!  <g>

Bill

William K. Reger
Senior Project Manager
Levitz Furniture Corporation
Phone:  (561) 994-5114
E-mail:  breger@levitz.com <mailto:breger@levitz.com> 
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.