I would like to use [expr] for an "if, then, else" statement:

If $f3 > 0, then $f1 + $f2, else $f1 - $f2

In the help for [expr], I see the following:

[expr $f1;
if ($f1 > 0, $f1 * 2, 0);
if ($f1 <= 0, $f1 / 2, 0)]

So I try:

[expr $f1, $f2, $f3;
if ($f3 > 0, $f1 + $f2, 0);
if ($f3 < 0, $f1 - $f2, 0)]

but it doesn't create. I also tried without the final ",0" in each statement, and also this way:

[expr $f1, $f2, $f3;
if ($f3 > 0, $f1 + $f2, $f1 - $f2)]

Can someone explain to me the proper syntax for this?

D.

ps... gotta love the fact I can copy/paste text in and out of objects etc these days!


--
::: derek holzer ::: http://blog.myspace.com/macumbista ::: http://www.vimeo.com/macumbista :::
---Oblique Strategy # 142:
"Shut the door and listen from outside"

_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to