Roku Object Reference - imaginArt
Roku Object Reference - imaginArt
Roku Object Reference - imaginArt
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
else<br />
endif<br />
endwhile<br />
timeout.AddSeconds(30)<br />
timer.SetDateTime(timeout)<br />
timer.Start()<br />
print "unexpected event received"<br />
Example: This code creates a timer that triggers every minute using wildcards in the timer spec.<br />
st=Create<strong>Object</strong>("roSystemTime")<br />
timer=Create<strong>Object</strong>("roTimer")<br />
mp=Create<strong>Object</strong>("roMessagePort")<br />
timer.SetPort(mp)<br />
timer.SetDate(-1, -1, -1)<br />
timer.SetTime(-1, -1, 0, 0)<br />
timer.Start()<br />
while true<br />
ev = wait(0, mp)<br />
if (type(ev) = "roTimerEvent") then<br />
print "timer event received"<br />
else<br />
print "unexpected event received"<br />
endif<br />
endwhile<br />
Example: This code creates a timer that triggers once at a specific date / time.<br />
timer=Create<strong>Object</strong>("roTimer")<br />
mp=Create<strong>Object</strong>("roMessagePort")<br />
timer.SetPort(mp)<br />
timer.SetDate(2008, 11, 1)<br />
timer.SetTime(0, 0, 0, 0)<br />
timer.Start()<br />
while true<br />
ev = wait(0, mp)<br />
if (type(ev) = "roTimerEvent") then<br />
print "timer event received"<br />
else<br />
print "unexpected event received"<br />
endif<br />
endwhile<br />
37