RE: bug or feature?
RE: bug or feature?
- Subject: RE: bug or feature?
- From: Joe Kelly <email@hidden>
- Date: Mon, 24 Dec 2001 12:21:37 -0800
Paul Berkowitz hat geschreibt:
>
It might be nice if it actually canceled with an error number
>
-128, as the
>
user expects, IF the button says "Cancel" on it, perhaps. But
>
since you can
>
actually change the name of that button to say other things,
>
you need to
>
have 'false' as a way of keeping the script going to do other
>
things if the
>
user pushes that button when it says, perhaps "Help".
>
>
So, yes, you need to trap for false.
>
When I first used "choose from list" I assumed that if the user pressed
cancel, it would return an empty list {}. So I could do something like "if
theChoice is not {} then". This makes perfect sense if I specify "without
empty selection allowed" -- if I get an empty selection, no sweat, I'll
assume the user canceled.
Unfortunately, choose from list returns one of two basically un-coercible
types: list and boolean. In theory it would be odd but acceptable (as I see
it : ) to provide built-in coercion of class boolean and class list:
{a, b, c} as boolean --> true
{} as boolean --> false
true as list --> {true} (as is presently implemented)
false as list --> {} (present implementation evals to {false})
Happy Holidays fellow scripters!
joe