Yes, this looks clear and logical.

----- Original Message ----- From: "Clifton Oliver" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Wednesday, July 25, 2007 5:52 PM
Subject: Re: [U2] [u2] : Cleaner Case Statement


begin case
   case Ans = 'A'
      gosub Check.A
   case Ans = 'B' or Ans = '2'
      gosub Check.B
end case

Execution should flow top to bottom, not left to right, from a comprehension viewpoint.


--

Regards,

Clif

On Jul 25, 2007, at 8:48 AM, Brutzman, Bill wrote:

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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to