Code: Select all
MsgBox % 1?1:0 ; works
m % 1?1:0 ; does not work
m(p){
}
Code: Select all
MsgBox % 1?1:0 ; works
m % 1?1:0 ; does not work
m(p){
}
Code: Select all
MyMsgBox %Question%? Answer: 42.
indeed very trueHotKeyIt wrote:I think flexibility is the point, so we should keep it
I think this should be solved the way lexikos suggested.
One line ternary is not used widely I think and not many scripts will be broken and you most likely will receive the right error message. Also fix is very simple, just wrap in (expr ? 0 : 1).
When we force to use , for commands, much more script would need to be changed.
Code: Select all
msgboz, (This is incorrectly assumed to be a function call, so the typo is not reported)
msgobx, [As above]
foo,++ ; v1 says: "+=" requires that parameter #2 be non-blank.
foo,? ; Treated as an expression. v2 complains about the missing ':'.
+1Make ternary lower precedence than commands, so cmd ? ... is always a command.
Users browsing this forum: No registered users and 24 guests