Code: Select all
MsgBox() ;Press OK to continue.
MsgBox(,, "") ;(blank)
https://lexikos.github.io/v2/docs/commands/MsgBox.htm
If all the parameters are omitted, the MsgBox will display the text "Press OK to continue.".
Code: Select all
MsgBox() ;Press OK to continue.
MsgBox(,, "") ;(blank)
If all the parameters are omitted, the MsgBox will display the text "Press OK to continue.".
Code: Select all
Msgbox(,,)
Comment in source// The macro below defaults to "", since that is by far the most common default.
// This allows it to skip the check for SYM_MISSING, which always has marker == _T("").
For autohotkeyWhen called explicitly with zero params, it displays this default msg.
Code: Select all
if (aText == _T(""))
aText = _T("Press OK to continue.");
Code: Select all
_f_param_string_opt(aText, 0);
Code: Select all
if (!aParamCount) // When called explicitly with zero params, it displays this default msg.
{
result = MsgBox(_T("Press OK to continue."), MSGBOX_NORMAL, NULL, 0, dialog_owner);
}
Code: Select all
MsgBox(,,)
What would you expect from msgbox ,,2 ?I might have expected omitting the first parameter to give 'Press OK to continue.', and perhaps it would be desirable, because if I wanted blank text, I could just specify "".
Code: Select all
MsgBox()
MsgBox(,,)
I think that was coffee's point, it makes more sense, but I argued against having any expectations on f(,,), with it not being defined.- The point is that these behave differently. Even though all parameters are omitted.
The only surprise is f(,,) not being an error.The current behaviour breaks the principle of least astonishment/surprise
srcTrailing empty function parameters are not supported.
I see you misunderstood, please let me try again, would you expectWhy did you bring up the AHK v1 MsgBox command?
Code: Select all
msgbox(,,2) ; Cancel, try again, ignore
Unless the buttons are modified from the default, omitting the text parameter [no matter how many other parameters are omitted] will set the text to "Press OK to continue." If the buttons have been specified other than the default, [the text will be ""](or whatever it should be).
I disagree .that's some good left-field thinking
It isn't suitable for any of the button options."Press any Button to continue".
That is very diplomatic .So lets change the behaviour and the docs.
I agree .I'd vote to remove it and display blank instead.
Could you elaborate what you mean by that?Helgef wrote:It isn't suitable for any of the button options."Press any Button to continue".
Exactly what was fixed? I considered these not being errors, erroneous,lexikos wrote:The behaviour of f(,,) was fixed in v2.0-a090.
Code: Select all
msgbox(,,)
f(,,)
f(p*){
}
Code: Select all
msgbox(,,,,,,,,,,,,,)
I guess it was that.coffee wrote:For autohotkey
Msgbox() <- zero params
Msgbox(,,) <- not zero params
Return to “AutoHotkey Development”
Users browsing this forum: No registered users and 19 guests