AutoHotKey 可以批量初始化数组吗?
Is it possible to initialize array in batch in AutoHotKey?
我知道我会写
a := Object()
a[1] := "textA"
a[2] := "textB"
a[3] := "textC"
我可以这样写吗
a := {"textA", "textB", "textC"}
?
您可以使用方括号语法定义 索引数组:
a := ["textA", "textB", "textC"]
或数组创建函数:
a := Array{"textA", "textB", "textC"}
索引数组是一个 对象,表示项目列表,编号为 1 及以上。在此示例中,值 "textA" 存储在对象键 1 中,值 "textB" 存储在对象键 2 中,值 "textC" 存储在对象键 3 中。
我知道我会写
a := Object()
a[1] := "textA"
a[2] := "textB"
a[3] := "textC"
我可以这样写吗
a := {"textA", "textB", "textC"}
?
您可以使用方括号语法定义 索引数组:
a := ["textA", "textB", "textC"]
或数组创建函数:
a := Array{"textA", "textB", "textC"}
索引数组是一个 对象,表示项目列表,编号为 1 及以上。在此示例中,值 "textA" 存储在对象键 1 中,值 "textB" 存储在对象键 2 中,值 "textC" 存储在对象键 3 中。