It is currently February 29th, 2020, 3:36 am

## Odd and even numbers

Help with creating, editing & fixing problems with skins
Wim
Posts: 26
Joined: September 22nd, 2010, 8:30 pm

### Odd and even numbers

Is there a way to establish whether a week number is an odd number or an even number (and preferably not in Lua)? I intend to make a schedule where on even weeks this happens and on odd weeks that. It's a repeating pattern. I've searched the forum but i haven't found anything relating to it. Any help would be welcome ...
jsmorley
Developer
Posts: 20297
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

### Re: Odd and even numbers

Wim wrote:
February 10th, 2020, 7:43 pm
Is there a way to establish whether a week number is an odd number or an even number (and preferably not in Lua)? I intend to make a schedule where on even weeks this happens and on odd weeks that. It's a repeating pattern. I've searched the forum but i haven't found anything relating to it. Any help would be welcome ...

Code: Select all

``````[MeasureCalc]
Measure=Calc
Formula=51
IfCondition=MeasureCalc %2 = 0
IfTrueAction=[!Log "[MeasureCalc] is EVEN"]
IfFalseAction=[!Log "[MeasureCalc] is ODD"]
``````
So any EVEN number can be equally divided by 2. No ODD number can.
Wim
Posts: 26
Joined: September 22nd, 2010, 8:30 pm

### Re: Odd and even numbers

I had that same idea about being divisible in two but couldn't come up with a method to make it work. Thanks a ton!