× 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: "Denis Robitaille" <DRobitaille@xxxxxxxxxxxx>
  • Date: Thu, 20 Apr 2000 16:33:13 -0400

Is'nt that funny how everybody knows all the pros and cons and that nobody want 
to replay all the arguments, but we always do? (myself included). 

A lot can be said for or against DOW and DOU. I think that whatever the choice, 
you should try to stick with just one of the 2. I understand that for contract 
programmer, this may not be an option.

Personnaly, my preference if for something that does not exist in RPG. I call 
it the generalized loop. I first saw this in the LISP language.

It would look like this in RPG:

c            loopB                                  * loop begin
c  key    chain    file            55          * some code
c            loopT           *in55 = *off     * loop test
c            eval .....                              * some code
c            loopE                                  * loop end

This structure combines both DOW and DOU.

 If there is code between loopB and loopT, you have a DOU. 

 If there is code between loopT and loopE, you have a DOW.

And best of all, you can have code before AND after the test that control the 
looping.

I would love to see something like that in RPG. It would make both DOW and DOU 
obselete.

Denis Robitaille
Directeur services techniques
Cascades Inc
819 363 5187
fax 819 363 5177


>>> <Mike.Barton@ecsoft.co.uk> 04/20/00 01:18pm >>>


Just to add my 2 pennies worth, I prefer the DOW construct.

One advantage is that it effectively has a 'first cycle processing'
section which can easily be inserted:

     Key         ChainFile                  80
      *in80       Ifeq *off
     { first clycle processing in here }
                  Endif

     *in80       DowEq*Off
      { main processing here }
      Key         Reade File                      80
                  Enddo


+---
| 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 
+---

+---
| 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 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.