Code: Select all
While WinActive(winTitle) {
;Input, key, VL1, % ""
key := InputHook(VL1, "")
Switch
{ Case !WinActive(winTitle)
, StrLen(ErrorLevel) > 3: state =
Case Instr(".!?%" , key) : state = 1
Case Instr("`t `n", key) : state += (state = 1)
;Default : Send % state = 2 ? Format("`b{:U}", key) : ""
Default : Send state = 2 ? Format("`b{:U}", key) : ""
state =
}
}
Problem with this is that Line 13 of the code is the line that ends state = There is no closing brace } on that line at all, yet the interpreter seems to think that what is on that line is state =}Error: Unexpected "}"
Text: state = }
Line: 13
File: E:\PORTABLES\- AutoHotKey\AutoHotkey v2.0.0\Scripts\Test.ahk2
The program will exit.
What is going wrong with this? It seems the interpreter isn't matching up braces properly and thinking there is braces where none exist.