--- On Fri, 5/15/09, padovani <josepadov...@yahoo.com.br> wrote:
> From: padovani <josepadov...@yahoo.com.br>
> Subject: Re: [PD] [expr] for "if, then, else"?
> To:
> Cc: pd-list@iem.at
> Date: Friday, May 15, 2009, 2:15 PM
> You don't need to declare the
> variables...
>
> it is just:
>
> [expr if ($f3 > 0, $f1 + $f2, 0);
> if ($f3 < 0, $f1 - $f2, 0)]
>
> but you will have 2 outlets (one for each "if"), and not an
> "else" for
> the same outlet.... in fact, it would be nice to have an
> "else" on
> Yadegari's externals...
> For more information see: http://www.crca.ucsd.edu/~yadegari/expr.html
Hi José
I think the final 0 before the semicolon is the "else" part of the
statement. [expr if ($f3 > 0, $f1 + $f2, $f1 - $f2)] will give you only one
outlet. You can even nest if statements:
[expr if ($f3 > 0, $f1 + $f2, if ($f3 < 0, $f1 - $f2, 0))]
-Jonathan
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list