Mark,
Although I usually agree with you, this time I have to disagree. Using a CASE statement in this way seems a very clear way to handle something, especially when you're checking for a huge number of reasons to "disqualify" something from happening. Have you ever programmed the Federal Financial Aid calculations? They have tons of things to check for before allowing a calculation. In my opinion, something like

BEGIN CASE
 CASE FIRST.DISQUAL.CHECK; NULL
 CASE SECOND.DISQUAL.CHECK; NULL
...
...
 CASE TWENTIETH.DISQUAL.CHECK; NULL
 CASE 1
      DO MONSTROUS CALC
END CASE

is much cleaner and easier to read (and modify every single year) than a huge IF-THEN statement!
-Dianne

MAJ Programming wrote:

IMHO, using CASE as a replacement for IF's is extraneous. Meaning a harder
alternate than what should be the simpler form. CASE statements resolve to
being IF statements when compiled anyway.

CASE statements are best used for their original purpose. That is to
evaluate multiple conditions and only accept the first valid one and provide
an easy way to not consider the latter tests. Thus, each separate CASE
statement should have the thought process of individually being used instead
of just cascading all the negatives.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to