Forums > MaxMSP

exp or if object help

October 16, 2007 | 1:31 pm

im trying to write: "if $1 is equal to 1 or 3 or 5 or 7 or 9 then send out that number or else send out 0."

whats the best way of doing that? can i do that using the if or exp object or is there another way?
thanks


October 16, 2007 | 1:41 pm

[if $i1 % 2 != 0 && $i1 < 10 then $i1 else 0]

jb

Am 16.10.2007 um 15:31 schrieb Paul de Casaparis:

>
> im trying to write: "if $1 is equal to 1 or 3 or 5 or 7 or 9 then
> send out that number or else send out 0."
>
> whats the best way of doing that? can i do that using the if or exp
> object or is there another way?
> thanks
> ______________


October 16, 2007 | 1:50 pm

aww thanks alot, ive always been wondering about things like that! great help


October 17, 2007 | 12:28 pm

i was also wondering where i could read up on more info about that type of programming. i get a bit confused with the && and all the others…
any help would be great.
paul


October 17, 2007 | 12:50 pm

Seconded.
A syntax guide for objects like expr, if, sprintf etc.
would be a useful addition to the documentation,
cheers
Roger

— Paul de Casaparis

wrote:

>
> i was also wondering where i could read up on more
> info about that type of programming. i get a bit
> confused with the && and all the others…
> any help would be great.
> paul
>


Viewing 5 posts - 1 through 5 (of 5 total)