Goto


跳转到指定的标签并继续执行。

Goto, Label

参数

Label 要跳转到的标签名称。

注意

当使用一个动态标签比如 %MyLabel% 时,如果标签不存在,将会显示一个错误对话框。要避免这种情况,可事先调用 IsLabel()。例如:

if IsLabel(VarContainingLabelName)
Goto %VarContainingLabelName%

不鼓励使用 Goto,因为它通常使脚本不太易读并且难以维护。可以考虑使用 Else, Blocks, BreakContinue 来代替 Goto。

相关命令

Gosub, Return, IsLabel(), Else, Blocks, Break, Continue

示例

Goto, MyLabel
...
MyLabel:
Sleep, 100
...
翻译: Kookee 修正:天堂之门 menk33@163.com 2008年9月24日