question about [if]

Oct 12, 2008 at 4:40pm

question about [if]

hi,

is it possible to use only one if … then for this ?
and how can i get more information about [if] object ?

thx.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 405 136 20 196617 10;
#P number 211 97 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 211 252 18 196617 t i;
#P newex 312 229 103 196617 if $i1 >= $i2 then -1;
#P newex 211 273 32 196617 print;
#P objectname u327000137;
#P newex 211 229 98 196617 if $i1 < = $i2 then 1;
#P comment 440 157 29 196617 max;
#P number 405 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 334 157 29 196617 min;
#P number 299 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 9 0 2 0;
#P connect 8 0 4 0;
#P connect 8 0 6 0;
#P connect 0 0 4 1;
#P connect 2 0 6 1;
#P fasten 6 0 7 0 317 249 216 249;
#P connect 4 0 7 0;
#P connect 7 0 5 0;
#P window clipboard copycount 10;

#40298
Oct 12, 2008 at 5:07pm

Hi.
As you can’t use multiple/nested “if” (as “elseif”) with [if] object, I
use workarounds based on [expr] for this kind of stuff.
It might give you some ideas…

Ciao

max v2;
#N vpatcher 25 69 665 575;
#P window setfont MPW 9;
#P number 227 284 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 227 256 209 196617 expr ($i1< =$i2)*1 + ($i1>=$i3)*-1;
#P message 417 149 21 196617 10;
#P number 227 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 452 170 29 196617 max;
#B color 0;
#P number 417 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 357 169 29 196617 min;
#B color 0;
#P number 322 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 6 0 7 0;
#P connect 4 0 6 0;
#P connect 0 0 6 1;
#P connect 2 0 6 2;
#P connect 5 0 2 0;
#P pop;

#142418
Oct 12, 2008 at 5:41pm

great.
i’ll think about…
thx.

> I use workarounds based on [expr] for this kind of stuff

#142419
Oct 13, 2008 at 10:01pm

[split] is your friend.

#142420
Oct 14, 2008 at 1:19pm

obviously !
thx.
>
> [split] is your friend.
> –
> —-
> Peter Castine
>

#142421

You must be logged in to reply to this topic.