I stumbled across the same issue, but I couldn't make it work.
This is what I put in the main.brs
sub RunUserInterface()
user_id = regread("id","user_data")
user_sub = regread("sub","user_data")
?user_id
?user_sub
m.global = screen.getGlobalNode()
m.global.AddField("userId", "string", false)
m.global.AddField("subscription", "string", false)
m.global.userId = user_id
m.global.subscription = user_sub
? "User sub global = " + m.global.userId
if user_id <> invalid then
ShowContens(invalid)
else
ShowLogin(invalid)
end if
end sub
And I got this error here in the console:
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Current Function:
004: sub RunUserInterface()
005:
006: user_id = regread("id","user_data")
007: user_sub = regread("sub","user_data")
008: ?user_id
009: ?user_sub
010:
011:* m.global = screen.getGlobalNode()
012: m.global.AddField("userId", "string", false)
013: m.global.AddField("subscription", "string", false)
014: m.global.userId = user_id
015: m.global.subscription = user_sub
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/source/main.brs(11)
011: m.global = screen.getGlobalNode()
Backtrace:
#0 Function runuserinterface() As Void
file/line: pkg:/source/main.brs(11)
Local Variables:
global Interface:ifGlobal
m roAssociativeArray refcnt=2 count:0
user_id roString (2.1 was String) refcnt=1 val:"test@example.com"
user_sub roString (2.1 was String) refcnt=1 val:"False"
screen <uninitialized>
Brightscript Debugger>
Any ideas?