Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mixe
Visitor

brightscript 3.0 modulo

I'm having a bit of problem using MOD. I can't seem to workout what format this function should use. I have tried using mod(n,val) which just caused an error and n mod val didn't work either. I assumed as NOT uses the format not(val) then it would be the same for mod.
0 Kudos
2 REPLIES 2
gonzotek
Visitor

Re: brightscript 3.0 modulo

It's an operator(like "+", "-", "*", "/"), not a function. Try something like this:
tick_count = 3
if tick_count mod 3 = 0 then
doSomethingHere
end if
Also I think you should be able to use 'NOT val'. The parentheses just indicate order of operation (e.g. "not(b>40)" first compares b to 40 then NOTS the result).

/edit: Also see RenoJim's comment below.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
renojim
Community Streaming Expert

Re: brightscript 3.0 modulo

print 11 mod 3 works for me. Stupid question, but your firmware is v3.0 or above, right?

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.