Yes, unless "Func" is part of an object and you call through that object, adamkaz is correct. Take this example:
Sub Main()
m.myval = "some value"
Func() ' will print "some value"
o = {}
o.func = Func
o.func() ' will print invalid
End Sub
Sub Func()
print m.myval
End Sub
Now if you are calling Func through an object and you want to access m.myval that was set in Main, that's where GetGlobalAA comes into play:
Sub Main()
m.myval = "some value"
Func() ' will print "some value" twice
o = {}
o.func = Func
o.myval = "some other value"
o.func() ' will print "some value" and "some other value"
End Sub
Sub Func()
globalm = GetGlobalAA()
print globalm.myval ' prints "some value"
print m.myval ' prints "some other value"; m in this case is referring to o that was declared in Main
End Sub
All code above is untested, but it should be correct.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.