How do you do Modulo in Brightscript?
I can't find it in the docs. It's not the % operator.
This has changed since 2010.
You modulo by writing MOD between two numbers, eg:
remainder = 20 MOD 19
Never done that, but this might work in brightscript
function Modulo(a as integer, b as integer) as integer
if b = 0 then
print "cannot divide by 0"
stop
else if b = 1 then
return 0
else if a >= b then
return a - cint(a/b) * b
else if a < b
return a
end if
end function
Can't find what you're looking for?
Contact support