Originally Posted By: Chrisi
Btw: I still don't understand why you say it works as intended. ... I don't see why no/cancel should return $null for the ev switches.


I explained clearly above, please re-read my post. The help file line that you quoted explicitly states the behavior in question: "If there is an input editbox, the ok/yes buttons always return the contents of the editbox."

Keyword: always.

$null is synonymous with the empty string in mIRC, in other words, they are equivalent representations:

//var %x = "" | echo -a $iif(%x == $null,$true,$false)

You are getting back the empty string from the input box, you don't actually get back "$null", but it is equivalent to $null, which is probably why you think that's what mIRC is returning. They are the same thing.

Originally Posted By: Chrisi
And who on this earth would type in $false, $cancel, and so on, in an editbox?


Anyone. Why are you even asking this? The fact that it's possible is the problem. It's not mIRC's job to place limitations on what people should and shouldn't be doing with the scripting language. A few very obvious examples: an input box may be used to help someone provide scriptable values, like "Please enter the auto-op condition to be evaluated when the user joins your channel", $false being "never".

Originally Posted By: Chrisi
In fact it breaks scripts the way as it is at the moment.


By definition, the existing behavior cannot "break" scripts, because it is the existing behavior. If you are using an $input with an editbox and are relying on this behavior your script is not "broken"-- it never worked in the first place. The help file tells you that it will never work, so there is no expectation mismatch here.

Originally Posted By: Chrisi
As a scripter you want to know if the user clicks on ok with an empty editbox of if he clicks on cancel.


Why is this being stated as fact? Not every script needs this information-- only ones that allow the empty string as a valid input, which is not every script.

-------

The bottom line is this: Khaled can't just break existing scripts, so a new switch would be necessary here regardless of whether you agree with the current behavior or not.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"