I want to fetch an initial config XML, and store those settings for use later. I don’t see that brightscript has any sort of concept of global variables, or an easy way to access some long term stored variable. Ideally it’d be some config object I can create, and reference from anywhere. What’s the best way to do something like this?
You can pass your config data around as parameters to those functions that need to access it.
Or store it as a member of the global m http://sdkdocs.roku.com/display/RokuSDK … hispointer
Then, you can call GetGlobalAA() from within other objects to access the global m http://sdkdocs.roku.com/display/RokuSDK … AAAsObject
I’d really like to have something like
config = setupConfig();
config.add('debug',1');
if (config.get('debug') > 0) then
'do something
endif
I don’t see how I’d store something in the GlobalAA though.
Same as you store into any other AA.
config = GetGlobalAA()
config["debug"] = 1
if config["debug"] = 1 then
....
end if
–Mark
