Your Digital Media Has Never Looked So Good

Topic Author
Posts: 342
Joined: Fri Feb 15, 2013 2:08 pm


Wed Sep 28, 2016 4:42 am

I copied the procedure from the sdk but for some reason the getcontent() function is never entered. Why is this?  If i run the code under getcontent() from inside the init, it works. It does enter the init.

<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name="ContentReader" extends="Task" >

    <field id="content" type="node" />


 <script type="text/brightscript">
 sub init()
 print "INT" = "getcontent"
end sub

sub getcontent()
 content= createObject("RoSGNode","ContentNode")
 ut = CreateObject("roUrlTransfer")
 rocontent = ParseJson(ut.GetToString())
 for each items in rocontent.items
 end for


 for each item in scrollist
 items = content.CreateChild("ContentNode")
 items.HDSMALLICONURL = item
 end for = content

end sub

 function arraySlice(arr, start=invalid, finish=invalid, step_=1):
 res = [ ]
 for Q = start to finish step step_:
    if step_ = 0 then print "ValueError: slice step cannot be zero" : STOP
    if start = invalid then if step_ > 0 then start = 0 else start = arr.count() - 1
    if finish = invalid then if step_ > 0 then finish = arr.count() - 1 else finish = 0
    if start < 0 then start = arr.count() + start 'negative counts backwards from the end
    if finish < 0 then finish = arr.count() + finish
  end for
 return res
  end function



User avatar
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US


Sat Oct 01, 2016 1:41 pm

There's nothing in the code you pasted that actually runs the Task.  You need to set the task's control to "RUN" to get it to spin up its thread.
My Channels: - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)

Who is online

Users browsing this forum: No registered users and 11 guests