Personally I like the match or index syntax.
case ans match 'b':@vm:2 gosub checkb
case index('"b"2"',quote(ans),1) gosub checkb
I also continue to feel there is a very good case for subroutine indirection
which would give:
sub = 'check':ans
gosub @sub
You still have an oxhp.com address? I thought that oxhp was gone?
How're you doin'?
Dan Fitzgerald
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rotella, Leon M.
Sent: Wednesday, July 25, 2007 2:54 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2]
Hold the phone... That's a valid syntax? On what platform?
On 7/25/07, Martin Phillips <[EMAIL PROTECTED]> wrote:
>
> > "ON" is bad because it is in violation of the KISS principle. (Keep It
> So
> > Simple)
>
> You have to be kidding!
>
> Consider a simple menu option processor...
>
> INPUT OPT
Readability = better maintainability
ON/GOSUB # Readability
ThereforeON/GOSUB # better maintainability.
As one of my teenaged daughters would say, ON/GOSUB is sooo
1980s. :)
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Phillip
"ON" is bad because it is in violation of the KISS principle. (Keep It So
Simple)
You have to be kidding!
Consider a simple menu option processor...
INPUT OPTION
IF OPTION MATCHES '1N' THEN
ON OPTION GOSUB OPTION1, ;* helpful comment
OPTION2, ;* blah b
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 gosu
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
CASE ATTR = 202
G
To answer the question... that was not the original question.
The original question is just under "I would like something like..."
Martin Philips indicated that what I want cannot be done right now with
UniBasic.
--Bill
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED
"ON" is bad because it is in violation of the KISS principle. (Keep It So
Simple)
--Bill
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Perry Taylor
Sent: Wednesday, July 25, 2007 2:53 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] [u2] : Cleaner Ca
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 wa
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 effici
i like this idea! I may play around with it tonight ( I don't have data
to move around but I could create a file in unidata and try this idea)
results to follow ..
dougc
Stephen O'Neal wrote:
Another response from U2 Lab Services...
You could use the BASIC programs in UniVerse to m
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..Ba
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 Check.2
>case 1 ;
We have a great VAR, we seldom need them but when we do they come
through with flying colors but even they can not get IBM to get us an ID
to access this. I am posting the response I've gotten from our VAR on
this issue. They have tried to get us access to the locked articles in
the knowledge base
Martin:
Thanks very much indeed.
--Bill
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Martin Phillips
Sent: Wednesday, July 25, 2007 12:38 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] [u2] : Cleaner Case Statement
Hi Bill,
Unlike languages su
The if...end else...end structure is more difficult for humans to read. Of
course, this example is trivial. The "case" structure is 1000 times better
suited to modelling business logic, especially as decisions get to be more
complex.
Kevin King once wrote something like...Bill...you do not "ha
Another response from U2 Lab Services...
You could use the BASIC programs in UniVerse to make files in loadfile
format from the UniData files, and simply use loadfile in the uv/bin
directory to populate the UniVerse files with the data.
If UV and UD are on the same machines, the BASIC program c
For production systems I would probably NOT do it but for a test system
which was being used to move data from unidata to universe it's fine
(IMHO)
Dougc
_
Doug Chanco
Engineer Developer Senior, TLOTLD
Activant Solutions Inc.(tm)
Austin, Texas 78746
T: 800-678-
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, 2007 12:44 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] [u2] : Cle
Kevin,
What if the answer is Q?
I almost always put in a CASE 1 statement to catch anything that resulted
from a later code revision by a colleague or someone who follows me in a
job! (The 'almost' is to exclude one-shot programs that nobody should ever
run again.)
Susan Lynch
F.W. Daviso
Bill,
you could always overthink it:
ALIST = '*A*'
BLIST = "*B*2*'
TEST =
'*":ANS:'*'
BEGIN CASE
CASE
INDEX(ALIST,TEST,1) ; GOSUB CHECK.A
CASE
INDEX(BLIST,TEST,1) ; GOSUB CHECK.B
END
CASE
I use the '*' delimiters so that
an illegal answer of '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.Cmds<1, -1> = "A"
Beta.Cmds = ""
Beta.Cmds<1, -1> = "B"
Beta.Cmds<1, -1>
ON GOSUB..Bad. 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: u2-users@listserver.u2ug.org
Subject: Re: [U2] [u2] : Cleaner C
case Ans = 'B' in the third set means "do nothing when Ans = 'B', and
stop evaluating cases.
Surely you wouldn't wish to break millions of lines of code by changing
the meaning of the case syntax.
The "gosubs" should go on their own line.
-Original Message-
From: [EMAIL PROTECTED]
[mail
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
Bill Brutzman asked:
How can this structure be cleaned-up?
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.
Try this
ON index('AB2',Ans,1) GOSUB Check.A, Check.B, Check.B
Manu
- Original Message -
From: "Brutzman, Bill" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, July 25, 2007 5:48 PM
Subject: [U2] [u2] : Cleaner Case Statement
How can this structure be cleaned-up?
begin case
cas
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.
Use Case Ans matches "2]B", using the MV separator between the 2 and the
B
Laure Hansen,
City of Redwood City
Information Technology
1017 Middlefield Road
Redwood City, CA 94063
Tel 650-780-7087
Fax 650-556-9204
[EMAIL PROTECTED]
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL
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 (
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, b
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 Chec
>From: "doug chanco" <[EMAIL PROTECTED]>
>To:
>Sent: Tuesday, July 24, 2007 11:25 PM
>Subject: Re: [U2] Re: Move data files from Unidata to Universe
> I can confirm (that ud/uv will run fine on the same system) as I
> currently run jBASE 4.1, unidata 7.x amd universe 10.x on the same
> virtual
34 matches
Mail list logo