supposedlyGlobalVariable := \"blah\"
ARoutine()
{
localVariable := \"asdf\"
MsgBox, The global variable value is %supposedlyGlobalVariable%. The local variable v
This makes things easier:
https://www.autohotkey.com/docs/Functions.htm#SuperGlobal
Super-global variables [v1.1.05+]: If a global declaration appears outside of any function, it takes effect for all functions by default (excluding force-local functions). This avoids the need to redeclare the variable in each function. However, if a function parameter or local variable with the same name is declared, it takes precedence over the global variable. Variables created by the class keyword are also super-global.
Just declare your variable as global in the main script:
global supposedlyGlobalVariable := "blah"