Глобальная переменная не имеет глобальной области видимости
<code>supposedlyGlobalVariable := "blah" ARoutine() { localVariable := "asdf" MsgBox, The global variable value is %supposedlyGlobalVariable%. The local variable value is %localVariable%. } ^!X:: ;This assigns the hotkey CTRL + ALT + X to run the routine ARoutine() return </code>
Запустите код и результат:
<code>"The global variable value is . The local variable value is asdf." </code>
документация состояния:
Variable scope and declarations: With the exception of local variables in functions, all variables are global; that is, their contents may be read or altered by any part of the script.
Почему моя глобальная переменная не имеет области действия внутри функции?