Hints, tips and tricks for newbies
Moderators: Dorian (MJT support), JRL
-
Dexter1
- Pro Scripter
- Posts: 64
- Joined: Mon Jun 19, 2006 3:28 pm
Post
by Dexter1 » Fri Oct 17, 2008 8:14 pm
I want to evaluate the following to see if the user has entered an odd or even number, is this possble?
Code: Select all
Input>WeekNumber, Enter Week Number
Thanks,
Josh
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Fri Oct 17, 2008 8:46 pm
Mod by 2 and if the remainder is 0 it must be even:
Code: Select all
Let>weekNumber=5
Let>x={%weekNumber% mod 2}
If>x=0
//even
Else
//odd
Endif
-
Dexter1
- Pro Scripter
- Posts: 64
- Joined: Mon Jun 19, 2006 3:28 pm
Post
by Dexter1 » Fri Oct 17, 2008 8:56 pm
w00t! That works like a champ.
Thanks,
Josh
Thanks,
Josh