Variables AHK Gui添加编辑';无法访问s变量

Variables AHK Gui添加编辑';无法访问s变量,variables,autohotkey,Variables,Autohotkey,关于AHK,我有一个无法解决的问题。我的代码: begin() begin() { Global Input Gui, Add, Edit, vInput gInputChanged } InputChanged() { MsgBox, Your input is %Input% } 够简单了吧?但是,当触发InputChanged()时,变量Input永远不正确(它始终为空)。请参阅 例如: Input := "Hello" ; Our Variable Defi

关于AHK,我有一个无法解决的问题。我的代码:

begin()

begin() {
    Global Input
    Gui, Add, Edit, vInput gInputChanged
}

InputChanged() {
    MsgBox, Your input is %Input%
}
够简单了吧?但是,当触发
InputChanged()
时,变量
Input
永远不正确(它始终为空)。

请参阅

例如:

Input := "Hello" ; Our Variable Defined outside of our Function

begin() ; Call the function passing no Variables

begin() {
    Global Input
    MsgBox, Global! Input = %Input%
    InputChangedLocally(Input) ; Pass the Input variable which is 'Hello'

}

InputChangedLocally(Input) {
    Input .= " World!" ; Change Local variable
    MsgBox, Changed Locally %Input%
    OnlyGlobalInput()
}

OnlyGlobalInput() {
    Global Input

     ; Notice it is not 'Hello World!' even though we changed it above!

    MsgBox, Global! Input = %Input%
    InputNotPassedOrGlobal()
}

InputNotPassedOrGlobal() {
    MsgBox, Your input is %Input% ; Blank as we never accessed any thing!
}