For example:
Code: Select all
Statement := True
Hotkey, If, % Func && Statement
Hotkey, ^1, Test
Code: Select all
Statement := True
Hotkey, If, % Func && Statement
Hotkey, ^1, Test
Code: Select all
#SingleInstance Force
Statement := True
; Statement := False
fn := Func("t").Bind(True)
Hotkey, If, % fn
Hotkey, ^1, Test
Hotkey, If
Return
Test:
MsgBox, Test
Return
t(r) {
Global Statement
Return r && Statement
}
Code: Select all
#SingleInstance Force
Statement := True
; Statement := False
go := t(True) && Statement
Hotkey, If, go
Hotkey, ^1, Test
Hotkey, If
Return
Test:
MsgBox, Test
Return
#If go
#If
t(r) {
Return r
}
Code: Select all
Statement := True
; Statement := False
x := True
; x := False
key = ^1
Hotkey, If, t(x) && Statement
Hotkey, %key%, Test
Hotkey, If
Return
F3::
x := !x
SoundBeep, 1500
Return
Test:
MsgBox, Test
Return
#If t(x) && Statement
#If
t(r) {
Return r
}
Code: Select all
#SingleInstance Force
theRightValue := 3.141
Statement := True
x = 96.5
key = ^1
Hotkey, If, t(x) = theRightValue && Statement
Hotkey, %key%, Test
Hotkey, If
Return
Test:
MsgBox, Test
Return
#If t(x) = theRightValue && Statement
#If
t(r) {
abc := r + 9
; Return 2
Return 3.141
}
Code: Select all
Hotkey, If, % FUNCTION
Code: Select all
Hotkey, If, t(x) = theRightValue && Statement
Code: Select all
TEST := Func("Rolls").Bind(CX1, Y1, X2, Y2)
Code: Select all
Hotkey, If, % TEST
Code: Select all
TEST := Func("Rolls").Bind(CX1, Y1, X2, Y2)
Code: Select all
Hotkey, If, % TEST
Code: Select all
Hotkey, If, Rolls(CX1`, Y1`, X2`, Y2) && Statement
Code: Select all
#SingleInstance Force
Statement := True
CX1 := Y1 := X2 := Y2 := 54
Hotkey, If, Rolls(CX1`, Y1`, X2`, Y2) && Statement
Hotkey, ^1, Test, On
Hotkey, If
Return
F3::
Statement := !Statement
SoundBeep, 1500
Return
Test:
MsgBox, Test
Return
#If Rolls(CX1, Y1, X2, Y2) && Statement
#If
Rolls(CX1, Y1, X2, Y2) {
Return True
}
Code: Select all
Hotkey, If, Rolls(CX1`, Y1`, X2`, Y2) && Statement
The expression statement is repeated in an #If directive later in the script.The Hotkey command uses the string that you pass to it, not the original source code. Commas and deref chars (percent signs) are interpreted before the command is called, so may need to be escaped if they are part of the original expression. Escape sequences are resolved when the script loads, so only the resulting characters are considered
Expression must be an expression which has been used with the #If directive elsewhere in the script. Although this command is unable to create new expressions, it can create new hotkeys using an existing expression.