"if" object trouble

Sep 16, 2007 at 2:49pm

"if" object trouble

Hi,
maybe i miss something but when i use the if object the result only go to the next object (int) .. if i put a new object(like an other int) after the first int, nothing happen with the last int!
hum
trying will be more understanble than what i try to explain :)

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P number 64 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch2 54 300 39 32 0 0;
#P toggle 54 239 15 0;
#P window linecount 1;
#P newex 54 209 147 196617 if $i1 < 3 then set 1 else set 0;
#B color 5;
#P window setfont “Sans Serif” 12.;
#P number 54 181 40 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 0 4 0;
#P pop;

thanks

#33697
Sep 16, 2007 at 2:58pm

On 16 sept. 07, at 16:49, freeka wrote:

> Hi,
> maybe i miss something but when i use the if object the result only
> go to the next object (int) .. if i put a new object(like an other
> int) after the first int, nothing happen with the last int!
> hum
> trying will be more understanble than what i try to explain :)

The problem is not the if obejct, but that you send out a message
which is “set [int]” instead of just the int value. Toggle understand
that set message as display the new value (check or not), but do not
send the value to the output. In that particular case, you could have
use [< 3] instead of if, to obtain the same result, with less typing.

HTH,
ej

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P number 64 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch2 54 300 39 32 0 0;
#P toggle 54 239 15 0;
#P window linecount 1;
#P newex 54 209 147 196617 if $i1 < 3 then 1 else 0;
#B color 5;
#P window setfont “Sans Serif” 12.;
#P number 54 181 40 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 0 4 0;
#P pop;

#112583
Sep 16, 2007 at 3:09pm

Merci merci!

#112584

You must be logged in to reply to this topic.