|
John Carr wrote:
>
> Re: DOW vs DOU
>
> David, I mean Mr. Phelps
>
> <THANK YOU, Checkmate>
>
> Sorry but your whole mission impossible team was destroyed by just one
> of the benign looking but deadly DOW traps. (Now gather round boys and
> girls there is a valuable lession here)
>
> Mr. Phelps wrote;
>
> >Like this, you mean?
> >
> > KEY CHAINFILEXXX 90
>
> > *IN90 DOWEQ*OFF
> > XXCODE ANDNE'B'
>
> > XXCODE IFEQ 'A'
> > ITER
> > ENDIF
>
> > <.... whatever process ....>
>
> > KEY READEFILEXXX 90
> > ENDDO
>
> Whats wrong with this Code? Look at it carefully.
>
> If this code is actually run and the program incounters a XXXCODE = A from
> FILEXXX what you will notice is;
>
> First the lights will dim, and peoples tubes will seem to freeze,
> and you may not have enough resources to kill this job. BECAUSE.....
> the ITER opcode branchs TO the ENDDO statement and by passes the READE
> opcode. Then with lighting speed it will branch back up to the DOW
> statement and test the XXXCODE again, It will still be "A" and the process
> will continue. The whole program will be PAGED out except for this chunk
> of code and the machine will get Real Good, Real Fast at executing those 4
> statements.
>
> You in essence have a classic example of an INFINITE LOOP!
> The bottom line is that you CANNOT USE an ITER opcode with the DOW!
>
> Other than that your code does, how did you say it; "My example matches
> the structure of the code to the structure of the data, whereas yours
> doesn't.".
>
> That may be true but mine did have Brevity, and it had Clarity,
> and Succinctness, AND it didn't get into an Infinite Loop.
>
> In the world of Left hand indicators, GOTO/CAB's and spaghetti code,etc.
> our lofty discussions of "What is Structured Code" often gets drowned
> out by production deadlines, Byzantine standards, and the rest.
>
> As some french guy said of goverments "Of forms of goverments, let fools
> contest, that which is best adminstered is best" I believe it's true
> of Code as well. Maintainability is #1.
>
> Respectfully
>
> John P. Carr CDP
> EdgeTech
> 74711.77@compuserve.com 804-739-7689
>
> P.S. I'd like to meet you 3d sometime and have a beer. DOW aside I still
> Highly respect your opinions!
> thanks for the fun
>
> ------------------------------------------------------------------
> On May 25 1997 John P. Carr wrote:
>
> >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
>
I prefer this method John.
Whether to process the record or skip it being determined in a
subroutine. CHKRCD often will have several checks rather than just the
one shown here.
Maybe old habits are hard to break, in any case, i've seen alot worse.
KEY CHAIN FILEXXX
*IN90 DOWEQ *OFF While a record
XXXCODE ANDNE 'B' & not code B
EXSR CHKRCD Check Record
GOODR IFEQ 'Y' Process ?
<.... whatever process ....>
ENDIF End Process
KEY READE FILEXXX 90 Read Next
ENDDO
C* Check Record Subroutine
CHKRCD BEGSR
MOVE 'Y' GOODR
XXXCODE IFEQ 'A'
MOVE 'N' GOODR
ENDIF
ENDSR
--
Jim Welsh
Programmer/Analyst
B&B Cash Grocery Stores, Inc.
http://www.netcom.com/~jimwelsh/welcome.html
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 mailing list archive is Copyright 1997-2025 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.