Re: bug or feature?
Re: bug or feature?
- Subject: Re: bug or feature?
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 24 Dec 2001 15:34:09 -0500
Where do you see it says "Cancel" should throw an error number -128,
Deivy?
The statements were supposed to be to different phrases.
But strictly speaking you are right. "Cancel" is not error number -128,
the latter is more general and the former default action is only valid
in certain dialects.
That's what display dialog does, not choose from list. (Very
inconsistent,
yes. I think it's derived from the history that these were once separate
scripting additions, 'choose from list' being a 3rd-party, GTQ osax.)
'choose from list' has always returned false if canceled.
This I was not aware of. Thanks for the info.
What the Dictionary in AS 1.8 in OS 10.1.2 says is:
choose from list list of string -- a list of strings to display (an
empty list if no selection)
Result: list of string -- the list of strings chosen
It doesn't say anything about error number -128. of course, it doesn't
say
anything about 'false', either.
But it does explicitly mention "cancel button name". Thus, one expects
"Cancel" to work as usual (same thing for the "OK" button).
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".
I disagree with you here, Paul. It states on the dictionary "cancel
button name". You can call it whatever you want, but if you do not do
anything to trap the press button it should default to the usual cancel,
shouldn't it?
So, yes, you need to trap for false.
Yes, you are right here. I did it
Paul Berkowitz
Deivy Petrescu
http://www.dicas.com