Page 1 of 1

Posted: 22 Sep 2016, 12:00
by sephult
Hi Everyone!

Again running into a wall.

I am not finding any built in functions for Odd/Even detection.

At the moment trying to find out how to do this with what is available.
First was going to do a modulo and compare the remainder...but I don't know if exists.

Anyone know a way to find Odd/Even?

-s

Posted: 22 Sep 2016, 13:34
by senso
something like that?

Code: Select all

function isOdd(x:integer):boolean;
begin
  if x mod 2 = 0
  then result := true // odd
  else result := false; // even
end;

Posted: 22 Sep 2016, 16:53
by sephult
Great Senso thanks that was what i was looking to script. I didnt find mod in the documentation for operators and tried %. I will test and update documentation if not there.