compiler-errors - 复合行if语句在同一行花括号上的AutoHotkey阻塞

标签 compiler-errors autohotkey curly-braces

我有一个问题,AutoHotkey告诉我在“else”前面缺少{,我认为我的代码很好。 (直到我将与窗口相关的if从Pidgin更改为qutIM为止,它一直有效)

^!p::
   IfWinExist ahk_class QWidget, ,qutIM {  ;if there is a qutIM-window other than the buddy-list...
      IfWinNotActive ahk_class QWidget, , qutIM {  ;ans it is not active...
         WinActivate
      } else {  ;the closing bracket in front of the else here puts AHK off...
         WinMinimize
      } 
   } else {  ;do some stuff with the buddy-list
      ; [...]
   } 
return

我担心自己忽略了一些愚蠢的事情,但似乎无法解决这个问题。

最佳答案

如果我没记错的话,那么True True Brace样式仅适用于纯If语句,不适用于IfWinExist等化合物。

From the documentation for if-expressions:

The One True Brace (OTB) style may optionally be used with if-statements that are expressions (but not traditional if-statements).



就是您必须使用WinExist()表单,而不是IfWinExist。

关于compiler-errors - 复合行if语句在同一行花括号上的AutoHotkey阻塞,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1828197/

相关文章:

database - 公共(public)图书馆数据随时间变化

xcode - Swift 3 - 无法调用非函数类型 'XCUIElement' 的值

string - Haskell 中的 Data.Text 常量

variables - 以下变量名包含非法字符...但我不知道它可能是什么

c++ - 将括号初始化用于非平凡的多变量类

compiler-errors - AutoHotKey throw 错误: Unexpected “}” although the brackets appear to be correct

php - php源码中三个大括号放在一起

c++ - 指向模板抽象类的指针 vector ?

c - Makefile -o,为什么需要.o

internet-explorer - 专门针对 IE 6 的自动 Web 表单测试/填写