Hello,
I have two suggestions.
I have two suggestions.
- Avoid using an existing function name such as "Switch".
- See the documentation about global variables and their scope. Assigning a global var within a function requires declaring it as global within the function.
CODE:
#Requires AutoHotkey v2.0
swich := True
MsgBox swich
F2::output
F3::switchy
switchy() {
If !swich
Global swich := True
}
output() {
If swich {
MsgBox 'Yellow'
Global swich := False
} Else MsgBox 'Blue'
}
Statistics: Posted by mikeyww — 24 minutes ago