Re: Regarding EVALUATE TRUE



On Aug 16, 12:40 pm, docdw...@xxxxxxxxx () wrote:
In article <1187279407.749229.171...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,

klsha...@xxxxxxx <klsha...@xxxxxxx> wrote:

EVALUATE TRUE
WHEN CASE-IN-COMPLETE
SET IN-COMPLETE-CASE TO TRUE
PERFORM 1000-SET-CASE-TYPE-MSG
WHEN NO-CASE-EXISTS
SET NON-EXISTING-CASE TO TRUE
PERFORM 1000-SET-CASE-TYPE-MSG
WHEN CASE-EXISTS-BUT-NOT-EXACT
SET NON-MATCHING-CASE TO TRUE
PERFORM C110-SET-CASE-TYPE-MSG
WHEN CASE-EXISTS-EXACTLY
* *** NOW PROCESS VERY GOOD CASE ACCORDING TO ITS STATUS...

Gah... with all due respect, Mr Shafer, I disagree with what follows...
for two reasons.
EVALUATE TRUE
WHEN WEA1CAS-STATUS = IND-TYPE-OF-CASE
CONTINUE
WHEN WEA1CAS-STATUS > SPACE
AND CASE-OPEN OF WEA1CAS-SACSTAT
PERFORM 2000-FINISH-CASE-EDIT-S
WHEN WEA1CAS-STATUS > SPACE
AND CASE-CLOSED OF WEA1CAS-CASE-STATUS
PERFORM 3000-FORMAT-WEA1CASA
PERFORM 4000-UPDATE-WEA1CASA-6CASH
WHEN WEA1CAS-STATUS = SPACE
AND CASE-OPEN OF WEA1CAS-CASE-STATUS
IF CASE--OPEN OF CSN-CASE-STATUS
PERFORM 3000-FORMAT-WEA1CASA
PERFORM 4000-UPDATE-WEA1CASA-6CASH
ELSE
CONTINUE
END-IF
WHEN OTHER
CONTINUE

First reason... no END-EVALUATE for the interior EVALUATE.

OK, my brain is not a very good compiler, but you already knew
that :-). So I know this first reason is not *really* what you are
talking about, is it?

Second
reason... for reasons that are readily and immediately apparent to anyone
of good, decent, sane and sound judgement - in other words, a matter of
Style and Aesthetics - I try to alternate IF and EVALUATE for interior
logic.

Ahhh, yes, the real reason - I enroached upon your easily offended
artistic sensibilities. Let me respond in my (hopefully) usual genteel
fashion...

Hmmmm... I think I have read elsewhere about the Virtue of Alternating
IF/EVALUATE; it is not an Original Idea of yours, is it? It is not a
matter that brings forth strong feelings on my part. I could certainly
adhere to any such directive; I could certainly adhere to one without
it :-).

But rather than digress into that matter, let me emphasize what may be
the not-too-obvious. You and I here are now discussing what is under
only _one leg_ of the outer-EVALUATE. And the leg in question has as
its given a condition of CASE-EXISTS-EXACTLY. This is of itself a
significant step forward from where we were before.

After all, all of the code you challenged could now be encapsulated
into its own paragraph, and the exterior becomes...

EVALUATE TRUE
WHEN CASE-IN-COMPLETE
SET IN-COMPLETE-CASE TO TRUE
PERFORM 1000-SET-CASE-TYPE-MSG
WHEN NO-CASE-EXISTS
SET NON-EXISTING-CASE TO TRUE
PERFORM 1000-SET-CASE-TYPE-MSG
WHEN CASE-EXISTS-BUT-NOT-EXACT
SET NON-MATCHING-CASE TO TRUE
PERFORM C110-SET-CASE-TYPE-MSG
WHEN CASE-EXISTS-EXACTLY
* *** NOW PROCESS VERY GOOD CASE ACCORDING TO ITS STATUS...
PERFORM 2000-PROCESS-EXACT-CASE
WHEN OTHER
DISPLAY "BAD INTERNAL ERROR IN " WS-CURRENT-PARAGRAPH
PERFORM 999-ABEND-EXIT
END-EVALUATE

See, now we need only discuss what 2000-PROCESS-EXACT-CASE should look
like. We have now scoped and bounded the problem area a bit.
As I have said (indirectly) to the client - you have your choice - I
can rewrite this subsystem all at once, or one defect fix at a time.
My goals are modest - just make it a little bit better a fix at a
time.


(by the bye.. this code does not give the same results when
(IND-TYPE-OF-CASE = SPACES AND CASE-OPEN OF WEA1CAS-CASE-STATUS),
either... but That Could Never Happen, right?


Ummmmm, yes indeed, this is some of the perils of the Booleans in the
condition. And under what circumstances is the WHEN OTHER satisfied?
Will Mr. Dashwood please step forward to apply his De Morgan's
Laws? :-)

What was it you said earlier? Ahhh, yes, here it is...

"What should be considered the case when using a 'case' construct,
then, seems to be worthy of more than passing examination... LEFT-
HANDED does not rule out BROWN-EYED does not rule out HAS-SIX-TOES."

I believe that you are right on target here. To do such a "more than
passing examination" does not seem to be a merely pedantic exercise to
me. Rather, I think it gets right to the Heart of the Matter.

Ken

.