Welcome to %s forums

BrainModular Users Forum

Login Register

Scripting - Finding Odd/Even

I need help on a Patch
Post Reply
sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 22 Sep 2016, 12:00

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
"Every act of creation is first an act of destruction." -Picasso

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 22 Sep 2016, 13:34

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;

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 22 Sep 2016, 16:53

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.
"Every act of creation is first an act of destruction." -Picasso

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests