[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Evaluate Quiz -Reply
- Subject: Re: Evaluate Quiz -Reply
- From: Michael Lee <MLee@APPGROUP.COM>
- Date: Fri, 17 Apr 1998 15:22:37 -0700
Jim,
Whenever a 'when' argument is touched and entered, it will not enter the
when-other. Even if it enters the 'when' argument and changes the values
so that all the 'when' statements are false, it still initially entered the
'when' statement, and therefore will not execute the 'when-other' case.
Michael K. Lee
mlee@appgroup.com
The Application Group, Inc.
JHardest@LMBERRY.COM on 04/17/98 10:04:58 AM
Please respond to SQR-USERS@USA.NET
To: SQR-USERS@list.iex.net
cc: (bcc: Michael Lee/Application Group)
Subject: Re: Evaluate Quiz -Reply
Not to be difficult, but my copy of the release 3 documentation is not so
clear. The affect
of changing the value in the test arguement on the WHEN-OTHER clause is
unclear.
Mine states "WHEN-OTHER - Signifies the start of default commands to be
processed if
all other WHEN arguments are FALSE. WHEN-OTHER must appear after all other
WHEN
arguments."
It does NOT state "it ONLY enters the WHEN-OTHER when NONE of the WHEN
arguments were entered."
Which leads me to wonder...what if it enters one of the WHEN arguments but
a command
in the WHEN argument changes the value of the test argument such that none
of the
WHEN arguments is now true? Does it execute the WHEN-OTHER when it gets
there?
The question is: does it only execute the WHEN-OTHER if all of the WHEN
arguements
are false or does it only execute the WHEN-OTHER if none of the WHEN
arguements was
executed.
Two entirely different things. Easy to test, but the documentation is
ambiguous.
jim
Blah blah blah, opinions my own, not BellSouth's or The Berry Company's
blah blah blah.
>>> Michael Lee <MLee@APPGROUP.COM> 04/17/98 09:26am >>>
I have no idea what you are talking about. If you just READ the manual, it
clearly states that the WHEN-OTHER statement "Signifies the start of
default commands to be processed if all other WHEN arguments are FALSE.
WHEN-OTHER must appear after all other WHEN arguments."
This clearly states that it ONLY enters the WHEN-OTHER when NONE of the
WHEN arguments were entered.
Nothing is wrong with the documentation. As for the command, it is used
for branching purposes and it does the job of "branching to different
commands depending on the value of a specified variable or column."
Michael K. Lee
The Application Group, Inc.
mlee@appgroup.com
osmium@EROLS.COM on 04/16/98 07:22:33 PM
Please respond to SQR-USERS@USA.NET
To: SQR-USERS@list.iex.net
cc: (bcc: Michael Lee/Application Group)
Subject: Re: Evaluate Quiz
Dear Sir:
If you, an expert, had to experiment to find the method of
operation of the EVALUATE statement, it points to the weakness of the
SQR language documentation, which has few examples, and some oddly
phrased explanations. Maybe SQRIBE's next homework assignment should
be to get some better technical writers to improve their books.
Happy computing,
Ken Gartman
Eric Dimick Eastman wrote:
>
> Hi All,
>
> I agree with the camp that says leave it alone. I like how evaluate
> works (more now that I understand it). I can only think of two reasons
> to add a CASE statement:
>
> 1) So that C or Pascal programmers won't be surprised by the
> functionality. (I consider this a little weak. If you want to write
> SQR programs, learn SQR.)
>
> 2) So that the compiler could build a binary tree out of the CASE block.
> This would make large CASE blocks run much faster.
>
> So raise your hand if you have written a EVALUATE with more than about
> 100 WHEN clauses. You have been cheated out of performance.
>
> Are there other reasons?
>
> Cheers,
> Eric
>
> ------------------------------------------------------------------------
> Eric Dimick Eastman |Ray Ontko & Co|About 6,000 years ago, in 7 days,
> erice@ontko.com |Richmond, IN |God created the Earth, complete
> http://www.ontko.com| |with 5,000,000,000 years of history.