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




RE:     Re: DOW vs DOU
to;  (kahn@tco.infonet.com)

Ok David; (Mr Phelps)

Here's your assignment if you chose to accept it, Convert the following 
code of that infamous DOU connoisseur guy  John Carr to a DOW.  
Your score will be judged on Clarity, Brevity, and Succinctness. 
To be especially harsh you cannot code the same IF statement 
twice(But then, why should you need to?).


  KEY      SETLL  FILEXXX
 *IN90     DOUEQ  *ON
  KEY      READE   FILEXXX                 90
 *IN90     IFEQ   *ON
           LEAVE
           ENDIF

  XXXCODE  IFEQ    'B'
           LEAVE
           ENDIF

  XXXCODE  IFEQ     'A'
           ITER
           ENDIF
< ... end of in-line edits ...>

 <.... whatever process ....>

          ENDDO

(Don't berate me for not using a SELECT/WHEN in this example, I would have)
A combined LEAVE statement was not used for inclusion of Comments/Clarity .
(I generally view the *IN90 LEAVE as part of the Read function.)

If memory serves me, a "STRUCTURED ROUTINE"  is one with one Entrance & Exit,
No un-executable code(Logically controlled),  and all logic is 
controlled by only Structured constructs(IFs, DOs, WHENs,etc.) No Goto's

A "Proper Routine" is the same as the "Structured Routine" except that it 
also has the latitude to "Excape" or "LEAVE" a DO loop.  I can't remember 
if it also has the ability to branch to another "Interation".   I'm sure
that other languages have the ability to "ITER" and in fact other "GOOD"
programmers in "C" or other languages use it.

Before someone else "goes there",  I personally call the LEAVE & ITER 
opcodes, "Respectable Goto's"  because their destination is Exactly 
Determined, where as the GOTO or CAB can branch almost anywhere, including
OUT OF THE SUBROUTINE COMPLETELY! 

To wind this up this DOU/DOW thread I'll relate a humorous anecdote.

I was doing a 2 hour "RPG for Maintainability" session at COMMON and the
discussion turned to this debate.  I asked the 200-300 people how many used
each.  It was about 50/50.  There were very emotional responses on both 
sides, and fist fights almost broke out.  I had to call a ten minute break
and when they all came back, I noticed that a lot of them changed chairs 
to move near/away to/from certain people<G>.

After regaining our composure, We traced back where most people first used
one or the other. As it turns out, most did either one because that was the
 one they were first taught by Their mentor. It didn't seem like most really
thought about WHY they liked their way, But they were ready to fight to 
defend it. (BTW,  thats why I asked if you started out with COBOL because 
we determined it had a large correlation to the DOW during the session.)

I wonder if anyone reaches the age 10-15 and says "Ya know even though I 
was raised speaking English, I now see French is a much more descriptive
language.  I think I'll start using it instead of English. Just a thought.

Those are my opinions, But I'm probably wrong.

John P. Carr  CDP
EdgeTech
74711.77@compuserve.com   804-739-7689

P.S. The chance of mucking up the *IN within the DOU is noted. But I guess
that will not be a problem once we get File related EOF, NRF, etc. logical
variables in the future. Heh?


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  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.