Minimalist reproduction of the "problem": Create a file "constants.au3" with only this line:
global const $foobar = "apple"
Then create this script and launch it:
Func test()
#include <constants.au3>
EndFunc
#include <constants.au3>
msgbox(0,"",$foobar)
You'll get (only) this error:
"F:\test\test.au3" (6) : ==> Variable used without being declared.:
msgbox(0,"",$foobar)
msgbox(0,"",^ ERROR
Why? Why does it not find $foorbar declared? I suppose that the reason is that the