gpt4 book ai didi

How to nest '#If' conditions?(如何嵌套“#If”条件?)

转载 作者:bug小助手 更新时间:2023-10-28 21:16:15 26 4
gpt4 key购买 nike



I have tried the following, it throws an error, "unexpected {":

我尝试了以下方法,它抛出一个错误,“unexpected {":


#If !(MG_Active){
#If WinActive("ahk_exe foobar2000.exe")
WheelUp::
ToolTip, foobar2000 Up
Return
WheelDown::
ToolTip, foobar2000 Down
return

#If WinActive("ahk_exe firefox.exe")
WheelUp::
ToolTip, firefox Up
Return
WheelDown::
ToolTip, firefox Down
return
}

The following does not seem to work at all:

以下方法似乎根本不起作用:


#If
#If WinActive("ahk_exe foobar2000.exe")
WheelUp::
ToolTip, foobar2000 Up
Return
WheelDown::
ToolTip, foobar2000 Down
return

#If WinActive("ahk_exe firefox.exe")
WheelUp::
ToolTip, firefox Up
Return
WheelDown::
ToolTip, firefox Down
return
#If,

This works but I would like to reserve the use && for something else:

这是可行的,但我想保留使用&&用于其他用途:


#If WinActive("ahk_exe foobar2000.exe") && !(MG_Active)
WheelUp::
ToolTip, foobar2000 Up
Return
WheelDown::
ToolTip, foobar2000 Down
return

#If WinActive("ahk_exe firefox.exe") && !(MG_Active)
WheelUp::
ToolTip, firefox Up
Return
WheelDown::
ToolTip, firefox Down
return

Is it possible to get something akin to the first or second example?

有没有可能得到与第一个或第二个例子类似的东西?


Any help would be greatly appreciated!

如有任何帮助,将不胜感激!


更多回答

Forgot using #EndIf to enclose properly at any place? And please specify the syntax or programming language, using just a single tag isn't enough.

忘记在任何地方使用#EndIf正确封装?请指定语法或编程语言,仅使用单个标记是不够的。

@HarshitGupta, its AutoHotkey, I tagged it as so.

@HarshitGupta,它的AutoHotkey,我给它贴了标签。

优秀答案推荐

You can combine as many conditions as you want within an If-statement or #If directive - provided the combination is logical.

只要组合合乎逻辑,就可以在If语句或#If指令中组合任意数量的条件。


#If !(MG_Active) && ( WinActive("ahk_exe firefox.exe") || WinActive("ahk_class Notepad") )

$a:: MsgBox, b

#If ( (MG_Active) && WinActive("ahk_exe firefox.exe") ) && !WinExist("ahk_class Notepad")

$a:: MsgBox, c

#If

$a:: MsgBox, d

更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com