The 2nd set of syntax is the only one that will work if you want to do
the GOSUB when ANS equals either "B" or "2".



I don't agree that it's hard to read, but I don't like having multiple
statements on one line, separated by semicolons, I prefer to have the
case and the gosub on separate lines, but that's a matter of personal
preference.



Karen













-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brutzman, Bill
Sent: Wednesday, July 25, 2007 11:49 AM
To: '[email protected]'
Subject: [U2] [u2] : Cleaner Case Statement



How can this structure be cleaned-up?



  begin case

        case Ans = 'A'  ;  gosub Check.A

        case Ans = 'B'  ;  gosub Check.B

        case Ans = '2'  ;  gosub Check.B

  end   case



The following is more difficult to read.



  begin case

        case Ans = 'A'               ;  gosub Check.A

        case Ans = 'B' or Ans = '2'  ;  gosub Check.B

  end   case



I would like something like...



  begin case

        case Ans = 'A'  ;  gosub Check.A

        case Ans = 'B'

        case Ans = '2'  ;  gosub Check.B

  end   case



so that the "gosub Check.B" command is not repeated.  I have tried a few

alternatives without a victory.



Suggestions would be appreciated.



--Bill

-------

u2-users mailing list

[email protected]

To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to