exp or if object help

Oct 16, 2007 at 1:31pm

exp or if object help

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

#34193
Oct 16, 2007 at 1:41pm

[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
> ______________

#114992
Oct 16, 2007 at 1:50pm

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

#114993
Oct 17, 2007 at 12:28pm

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

#114994
Oct 17, 2007 at 12:50pm

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
>

#114995

You must be logged in to reply to this topic.