gpt4 book ai didi

autohotkey - 命令后的逗号有什么作用?

转载 作者:行者123 更新时间:2023-12-04 19:29:04 25 4
gpt4 key购买 nike

AutoHotkey Beginner Tutorial从使用 Send 的示例开始命令,命令及其参数用逗号分隔:

^j::
Send, My First Script
Return

...

SEND is the command, anything after the comma (,) will be typed.



后面给出了 MsgBox的例子不带逗号的命令:

esc::
MsgBox Escape!!!!
Return


实验上,似乎包含或省略逗号对命令的行为没有影响,至少在这些简单的情况下是这样。我们可以更改上面两个示例中是否包含逗号,命令仍然有效: MsgBox, Escape!!!有效, Send My First Script 也是如此.

是否存在语法需要逗号(或禁止它)的情况?包含逗号是否会以任何方式改变命令的语义?为什么这两种语法都允许?

最佳答案

AutoHotkey 中的逗号 ( , ) 是一个分隔符。第一个(在命令和第一个参数之间)是 completely optional in most circumstances :

Tip: The first comma of any command may be omitted (except when the first parameter is blank or starts with := or =, or the command is alone at the top of a continuation section). For example:

MsgBox This is ok.
MsgBox, This is ok too (it has an explicit comma).

关于autohotkey - 命令后的逗号有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47222968/

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