Page 1 of 1
Refering to an odd number
Posted: Wed Jul 23, 2008 6:48 am
by ac11ca
Is there some way in Rev to refer to an odd/even number? Something like:
Code: Select all
If gCount is an odd number then
do A
else
do B
end if
Cheers,
Adrian
Posted: Wed Jul 23, 2008 7:17 am
by Tim
Hi,
Use
Code: Select all
if gCount mod 2 is 0 then
--do something for an even number
else
-- do something for an odd number
endif
Regards,
Tim
Posted: Wed Jul 23, 2008 9:25 am
by Mark
Hi,
I do what Tim does and have created two functions. I keep them in a library, which is available to all my projects:
Code: Select all
function even theNr
return theNr mod 2 is 0
end even
function odd theNr
return theNr mod 2 is not 0
end odd
Best,
Mark