sub main ()
port = CreateObject ("roMessagePort")
screen = CreateObject ("roSpringboardScreen")
screen.SetMessagePort (port)
screen.SetContent ({ContentType: "episode"})
screen.Show ()
for each msg in port
print "Message received"
end for
end sub
sub main ()
port = CreateObject ("roMessagePort")
screen = CreateObject ("roSpringboardScreen")
screen.SetMessagePort (port)
screen.SetContent ({ContentType: "episode"})
screen.Show ()
while true
msg = wait (0, port)
print "Message received"
end while
end sub
"renojim" wrote:
It's probably got something to do with the Home key spewing invalid messages to the message port. Do you see a bunch of "Message received" strings when you run your second example? (I do when I try it.)
-JT
"belltown" wrote:
Still, I don't see why the Roku would crash in the first case if the for-each and while loops are supposed to be equivalent ways to read event messages. Does this seem like a firmware bug or a "feature"?
"belltown" wrote:
Out of curiousity, renojim, did the first example also crash your Roku?
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!