Your Digital Media Has Never Looked So Good

Topic Author
Posts: 21
Joined: Mon May 08, 2017 6:33 pm

Brightscript Error

Thu Aug 08, 2019 7:21 pm

I am getting the following error... What would cause this...
BRIGHTSCRIPT: ERROR: roSGNode.ObserveField: no active host node: pkg:/source/API.brs(37)

How can I fix this? This is occuring in a task

function API__Login(userData as Object) as Boolean
    result = true
    print "Logging in user:"
    account = userData
    m.LoginTask = createObject("RoSGNode","LoginTask")
    m.LoginTask.account = account
    m.LoginTask.control = "RUN"

    return result
end function

sub loginResult()

    if <> invalid then
        print "registry write"
    end if
end sub

The task runs but loginResult never is called.
Posts: 790
Joined: Wed Apr 20, 2011 11:48 am

Re: Brightscript Error

Tue Aug 13, 2019 12:21 pm

You should remove the lines: 
    return result

The "return" is breaking things for you, and there's no need for the "sleep".

In your callback you could print out

print "results: "; m.LoginTask.results

to make sure you're getting the response you expect.  You might need to get the result's "body" instead... If the callback is never triggered then you need to debug your task and make sure it's setting its ""

Who is online

Users browsing this forum: No registered users and 5 guests