Re: [U2] [u2] : Cleaner Case Statement

2007-07-27 Thread MAJ Programming
. - Original Message - From: Martin Phillips [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 12:37 PM Subject: Re: [U2] [u2] : Cleaner Case Statement Hi Bill, Unlike languages such as C, Basic does not allow multiple conditions in the way in which you are looking

Re: [U2] [u2] : Cleaner Case Statement

2007-07-27 Thread MAJ Programming
] : 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: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 5:48 PM Subject: [U2] [u2] : Cleaner Case Statement How can

Re: [U2] [u2] : Cleaner Case Statement

2007-07-27 Thread MAJ Programming
Subject: RE: [U2] [u2] : Cleaner Case Statement Someone want to explain to me why ON GOSUB is bdd ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Karen Bessel Sent: Wednesday, July 25, 2007 1:06 PM To: u2-users@listserver.u2ug.org Subject: RE

Re: [U2] [u2] : Cleaner Case Statement

2007-07-26 Thread SP
This is really ugly. In the company I work for such things are strictly forbidden by Standards. - Original Message - From: Manu Fernandes [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 5:44 PM Subject: Re: [U2] [u2] : Cleaner Case Statement Try

[U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Brutzman, Bill
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

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Karen Bessel
, 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: 'u2-users@listserver.u2ug.org' Subject: [U2] [u2] : Cleaner Case Statement How can

Re: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Kevin King
On 7/25/07, Brutzman, Bill [EMAIL PROTECTED] 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 If this is all you need, why not: IF (Ans = 'A')

Re: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Manu Fernandes
Try this ON index('AB2',Ans,1) GOSUB Check.A, Check.B, Check.B Manu - Original Message - From: Brutzman, Bill [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 5:48 PM Subject: [U2] [u2] : Cleaner Case Statement How can this structure be cleaned-up

Re: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Martin Phillips
Hi Bill, Unlike languages such as C, Basic does not allow multiple conditions in the way in which you are looking to do. In terms of run time performance or program size, if it really is just a GOSUB, there whould be little disadvantage in writing the more verbose form of your first example.

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Dave Davis
:[EMAIL PROTECTED] On Behalf Of Brutzman, Bill Sent: Wednesday, July 25, 2007 11:49 AM To: 'u2-users@listserver.u2ug.org' 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

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread David A. Green
The first structure emphasizes program flow based on Ans and is very readable. The second structure show program branching and is also readable. Another approach might be thus: Alpha.Cmds= Alpha.Cmds1, -1 = A Beta.Cmds = Beta.Cmds1, -1 = B Beta.Cmds1, -1 = 2 ...

Re: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Susan Lynch
. Davison Company, Inc. - Original Message - From: Kevin King [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 12:16 PM Subject: Re: [U2] [u2] : Cleaner Case Statement On 7/25/07, Brutzman, Bill [EMAIL PROTECTED] wrote: How can this structure be cleaned-up

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Dave Davis
] : 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: u2-users@listserver.u2ug.org Sent: Wednesday, July 25, 2007 5:48 PM Subject: [U2] [u2] : Cleaner Case Statement How can

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Perry Taylor
Someone want to explain to me why ON GOSUB is bdd ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Karen Bessel Sent: Wednesday, July 25, 2007 1:06 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] [u2] : Cleaner Case Statement ON GOSUB

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Rotella, Leon M.
To: u2-users@listserver.u2ug.org Subject: RE: [U2] [u2] : Cleaner Case Statement Not good if answer is not limited to one character wide. Isn't ON GOSUB out of style? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manu Fernandes Sent: Wednesday, July 25

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread gerry-u2ug
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: u2-users@listserver.u2ug.org Subject: RE: [U2] [u2] : Cleaner Case Statement Someone

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Dan Fitzgerald
] [u2] : Cleaner Case Statement Just to be different... Why not add a new label called Check.2 put it right before the label Check.B Then the code would look like: begin case case Ans = 'A' ; gosub Check.A case Ans = 'B' ; gosub Check.B case Ans = '2' ; gosub

Re: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Susan Lynch
: 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: u2-users@listserver.u2ug.org Subject: RE: [U2

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Stevenson, Charles
From: Clifton Oliver Execution should flow top to bottom, not left to right, from a comprehension viewpoint. Comprehension contributes to Maintainability, the premiere attribute of software quality. Along same lines, each case block should test the same sort of thing. Don't get sneaky for

RE: [U2] [u2] : Cleaner Case Statement

2007-07-25 Thread Allen E. Elwood
Hi Karen I've seen this used in after prompt subroutines, where there were literally multiple hundreds of Subroutines to execute, based on the attr number. In that case it's cleaner, and might I add easier, than HUNDREDS of lines of code that just say CASE ATTR = 1 GOSUB 1 SNIP 400 LINES OF