- Remove MsgBox smart comma handling.
- Remove A_MsgBoxResult.
- Change MsgBox usage as below (and InputBox and TrayTip further below).
MsgBox Text [, Title, Options, ByRef Result]
Result := MsgBox(Text [, Title, Options, ByRef Result])
I think that using an output parameter is more natural than having a built-in variable just for this function's return value. The output parameter could be exclusive to command mode, but it's just as easy (same amount of code) to have it in both modes.
Most (but not all) commands/functions with return values put the OutputVar first and omit it in expression mode, but doing that for MsgBox would mean writing
Options would be as it is now, or optionally a space-delimited list of more memorable string options. This is the part I'm not sure about - what string values to use. Currently I'm thinking this:
y/n, possibly altering the return value in that case to allow brevity when comparing the result - i.e.
MsgBox(Text,, "y/n") = "y"vs
MsgBox(Text,, "YesNo") = "Yes". However, Cancel/Try Again/Continue throws a spanner in the works (two 'C's). 'C' for Cancel is obvious with OK/Cancel, but Windows actually underlines Continue. (There's no mnemonic for Cancel - it's tied to Escape.)
For the icons, I think a single character resembling the icon is more memorable and convenient than a word like Stop/Error/Hand. I considered not requiring "Icon", but
xshould be reserved for possible use positioning the MsgBox.
I think the other options are less frequently used and can stay as numbers. A string of options could also include numeric options, combined or individually (just as the Gui command allows style options).
InputBox and TrayTip would have consistent parameter ordering:
Text comes first, as Title is often omitted. TrayTip's Seconds parameter may be removed completely (since it only works on XP) or merged into Options as a string.
This also makes TrayTip consistent with ToolTip and fixes the problem of
TrayTip Some textnot actually showing a TrayTip (it should be
TrayTip Title, Some textin v1).