if, then statement

Nov 29, 2011 at 2:08pm

if, then statement

Hello, I want to use the if-then object to route a number. However, I cannot get the number out of outlet 2. I cannot find the right statement in the help files. Can anyone help me out?

– Pasted Max Patch, click to expand. –
#60332
Nov 29, 2011 at 2:34pm

if $i1 < = $i2 then $i1 out1 else out2 $i1

#217146
Nov 29, 2011 at 2:37pm

You also need to specify what comes out of “out2″ ($i1? $i2? a bang?)
Example:

if $i1 < = $i2 then $i1 else out2 $i1

#217147
Nov 29, 2011 at 3:10pm

I wanted 4i1 coming out outlet 1 or 2. It is a bit weird that $i1 should be after out2 and not before like with out1. Anyway hz37: that is the correct statement it seems

#217148
Nov 29, 2011 at 5:09pm

The “out1″ is not a reserved word in this object, and is thus superfluous (and should be removed). It doesn’t show up in your patch because the number box and the button ignore it, but it’s being sent out.

You can think of the if statement’s format as:
if then [the left outlet] else [otherwise] out2 [create and use a second outlet to]
Note that out2 is optional, so you could elect to omit it and use the left outlet to .

– Pasted Max Patch, click to expand. –
#217149

You must be logged in to reply to this topic.