【问题标题】:Can you explain me the correct way to pass the Value? (Array to你能解释一下传递价值的正确方法吗? (数组到
【发布时间】:2020-04-19 00:19:51
【问题描述】:

我无法弄清楚为什么它没有正确传递值。输出应为 word2

 f12::
    target = 1
    string := "word1|word2|word3"
    S_Array := StrSplit(string, "|")
    string output = S_Array[target]
    MsgBox % "Output:" output
    return

当我使用时

MsgBox % "Output:" S_Array[target]

而不是一切都很好。但我需要将它存储到输出。我正在尝试很长时间。

【问题讨论】:

    标签: variables autohotkey


    【解决方案1】:

    你必须熟悉 AutoHotkey 的“表达风格”,这很肮脏/混乱。

    而且,AutoHotkey 的索引是 OneBased Not ZeroBased,再次令人困惑。

    最后,AutoHotkey 中不需要“Type”关键字

    【讨论】:

      【解决方案2】:

      而不是:string output = S_Array[target]

      你试过了吗:output := S_Array[target]

      另外,您可能想阅读:https://www.autohotkey.com/docs/misc/Arrays.htm

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-06-04
        • 1970-01-01
        • 2010-09-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多