License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Finding out if a Parameter is Odd or Even?

Anonymous
Not applicable
I searched through the forum, but couldn't find an answer to this:

How do I find out if a user input (integer) parameter is odd or even in GDL script?

Basically I want to do something that says If num (user integer input) EVEN then GOSUB:A, IF num (user integer input) ODD then GOSUB:B.

I really appreciate your help, I am at a loss here.

Thanks.
1 REPLY 1
Anonymous
Not applicable
Another way of saying that an integer x is even is to say that x mod 2 = 0. So...
IF num MOD 2=0 THEN !num is even
    GOSUB A
ELSE
    GOSUB B
ENDIF
should do the trick.