1
votes

This continuously sends t:

myVar := true

SetTimer, myLoop, 0

myLoop(){
    if (true) {
      Send, {t down}
    }
}

#Persistent

But this does nothing:

myVar := true

SetTimer, myLoop, 0

myLoop(){
    if (myVar) {
      Send, {t down}
    }
}

#Persistent

Why? myVar and true both evaluate to true so I don't understand why it's different.

1

1 Answers

2
votes

myVar := true should be:

global myVar := true

Because a global must explicitly be declared as such.