Code: Select all
#HotIf 'some string'
a:: MsgBox()
Code: Select all
#If "some string"
a:: MsgBox
Here, a creates a MsgBox.
Code: Select all
a:: {
if 'some string' {
MsgBox()
}
}
Code: Select all
#HotIf 'some string'
a:: MsgBox()
Code: Select all
#If "some string"
a:: MsgBox
Code: Select all
a:: {
if 'some string' {
MsgBox()
}
}
Code: Select all
abc() => "Triggered"
#HotIf abc()
a::MsgBox(abc())
#HotIf abc()?true:false
b::MsgBox(abc()) ; Triggered
Well, v1 is filled with weirdness, so nothing weird with v2 being less weird, i.e., #hotif and hotif being consistent. Though, non-numbers being being false might be considered an inconsistency .KingQuarter wrote: ↑11 Dec 2022, 13:05But it's still weird because in the v1 documentation, Hotkey, If, % FunctionObject also says it needs a non-zero number, but #If "some string" works fine.
!!abc()Simply use a ternary
Users browsing this forum: No registered users and 23 guests