One possible reason why it might be considered less than optimal:

From the UniData Basic Commands manual:

...If expr is less than or equal to 1, UniData transfers program control to the subroutine starting at the first label in the list...

So if ANS is Q in the code fragment below, you gosub Check.A. (Unless you are using BASICTYPE P or BASICTYPE M, in which case it drops to the next line of code - that is from a note on the previous page to the last quote...) If that is what you really want, ok, but it is certainly not going to be clear to the next poor soul who has to maintain the code! Or who might change the BASICTYPE and not realize the impact that it would have on your logic...

Susan Lynch
F. W. Davison & Company, Inc.


----- Original Message ----- From: "gerry-u2ug" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 25, 2007 3:36 PM
Subject: RE: [U2] [u2] : Cleaner Case Statement


I don't know either - this thread is the 1st time I ever heard that one.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Perry Taylor
Sent: July 25, 2007 02:53 PM
To: [email protected]
Subject: RE: [U2] [u2] : Cleaner Case Statement

Someone want to explain to me why ON GOSUB is baaaadd ?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Karen Bessel
Sent: Wednesday, July 25, 2007 1:06 PM
To: [email protected]
Subject: RE: [U2] [u2] : Cleaner Case Statement

ON GOSUB......Baddddddddddddd. Bill, that is a bad coding practice -
don't go there.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Manu Fernandes
Sent: Wednesday, July 25, 2007 12:44 PM
To: [email protected]
Subject: Re: [U2] [u2] : Cleaner Case Statement

Try this

ON index('AB2',Ans,1) GOSUB Check.A, Check.B, Check.B

Manu
----- Original Message ----- From: "Brutzman, Bill" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 25, 2007 5:48 PM
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/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
confidential and privileged information.  Any unauthorized review, use,
disclosure or distribution is prohibited. ZirMed, Inc. has strict
policies regarding the content of e-mail communications, specifically
Protected Health Information, any communications containing such
material will be returned to the originating party with such advisement
noted. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message.
-------
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/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to