.
- 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
] : 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
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
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
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
, 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
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')
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
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.
:[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
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
...
. 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
] : 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
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
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
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
] [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
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
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
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
20 matches
Mail list logo