I seem to have lost my sense of how the Global scope works. In this example $p is Global but I can't seem to set $p in function __One and then pass that version of $p to function __Two. I thought you could set a Global to a new value from within a function and it would affect the Global value.
I've stared and played with this code for over an hour and I'm missing something really basic. Help appreciated.
#AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK
Global $p = 999
MsgBox(0, "DEBUG", "MAIN - $p = '" & $p & "'")
__One()
Exit
Func __One()
;Global $p ;this seems to make no difference - comment it out to see - how does one affect the Global in a function?
MsgBox(0, "DEBUG", "Entering Func __One() - $p = '" & $p & "'")
For $p = 1 to 3
MsgBox(0, "DEBUG", "IN Func __One() - $p = '" & $p & "'")
__Two()
Next
EndFunc
Func __Two()
MsgBox(0, "DEBUG", "Entering __Two() $p = '" & $p & "'")
EndFunc