As others have mentioned, they're functionally equivalent.  The CASE
construct leaves it open for additional options, although I hardly think
that's a reason to use it, since it's simple enough to convert an
if/then/else to a CASE if need be.

>From a stylistic standpoint, I dislike if/then/else all on one line.  My
personal preference, which I find easier to read, is to do something like:

IF A = "TEST" 
    THEN GOSUB DO.SOMETHING 
    ELSE GOSUB DO.SOMETHING.ELSE

I don't know if this works in UniVerse, but it works fine in UniData
(although the FORMAT command in AE sometimes does funny things with it).

Larry Hiscock
Western Computer Services

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 12:52 PM
To: [email protected]
Subject: [U2] Case Statement with only two cases


Is there a point in code like this

BEGIN CASE
   CASE A = "TEST"; GOSUB DO.SOMETHING
   CASE 1; GOSUB DO.SOMETHING.ELSE
END CASE

versus this

IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB DO.SOMETHING.ELSE

Personally I see no advantage in making this a  CASE

Does the rest of the *Universe* agree with me?
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to