if, then statement

Thinksamuel's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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?

hz37's icon

if $i1

Pedro Santos's icon

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

if $i1

Thinksamuel's icon

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

Christopher Dobrian's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

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 .