Local variable scope extends to called function
chrisws opened this issue · 0 comments
chrisws commented
sub huh
'local k - workaround to avoid polluting foo's k
print k 'invalid: prints 123
k = 999
end
sub foo
local k
k = 123
huh()
print k ' invalid: prints 999
end
foo()
print k ' should be 999 since huh() changed global k
pause