[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Evaluate



Hello All,

I have attached a new version of the quiz.  I think that shows all the
quirks of evaluate (when it falls through, when it doesn't, what break
does, that it re-evaluates the variable for each when . . .).

I also re-read the documentation carefully, and I have one suggestion.
The wording "Determines the value of a column, literal, or variable and
takes action based on that value." is a little misleading.  It implies
that one value of the switching variable is compared to the WHEN clauses
instead of re-evaluating the variable each time.  I think "Tests each
WHEN clause in order to determine wich action(s) to take" would be more
accurate.  The biggest problem I had with the documentation was that I
didn't read it carefully the first time.

The one change to the documentation that would have made a difference
for me personally would be: "Just because you know three other
languages with similar constructs does NOT mean you know SQR's evaluate,
you arrogant little twerp."  However, that is not how manuals generally
read.

Eric

PS "Props" is GenX slang for a show of respect.  Similar to "a tip of
the hat" or a "laurel wreath" for the older audience.  Anyone surprised
that we, GenXers, have a word for respect?

------------------------------------------------------------------------
Eric Dimick Eastman |Ray Ontko & Co|Contentment is admitting that if you
erice@ontko.com     |Richmond, IN  |really wanted something you would
http://www.ontko.com|              |have it by now.



begin-program
move 1 to #t
evaluate #t
  when = 1
  when = 57
    show 'Match 1 or 57: ' #t edit 999
    move 3 to #t
  when = 2
    show 'Match 2: ' #t edit 999
    break
  when = 3
    show 'Match 3: ' #t edit 999
    move 4 to #t
    break
  when = 4
    show 'Match 4: ' #t edit 999
end-evaluate

show ''
move 4 to #val

evaluate #t
  when = #val
    show 'This is executed.'
    move 5 to #t
    move 5 to #val
  when = #val
    show 'So is this.'
    move 6 to #t
  when-other
    show 'This is not.'
end-evaluate

end-program