Hi all
I have this code
Opt("MustDeclareVars", 1)
local $var1 = "test"
foo()
func foo()
ConsoleWrite("var1: " & $var1 & @LF)
EndFunc
Because I can show the value of $var1 inside function foo()?
I think that if $var1 is a local variable should not propagate within func
and in this case I should receive an error.
What do you think?
guinness and water, This is my understanding from using AutoIt - I do not have access to the core code (nor would I understand it if I did! ): If not otherwise specified in the code, variables are scoped accoding to their location: Global if in main script; Local if in a function. In the Global case the variable is accessible throughout the script; If Local it is available in that function only and can only be referenced elsewhere if passed as a parameter. If specified in the code as Global