if
Description
Evaluates input according to a conditional statement specified in an if-then-else form.
Examples

Arguments
if [symbol]
The arguments for the if object start with a conditional statement that uses the same syntax as expr. The word follows the conditional statement, which is then followed by a message expression. After the message expression, there is an optional and a second message expression.
if evaluates the conditional expression, and if the result is non-zero, evaluates the message expression after the word . Otherwise, it evaluates the second message expression after the word if an message is provided.
then, else [symbol]
Message expressions are similar to what you type into a message box.
$i1, $f1, $s1 [symbol]
You use
, , or instead of for replaceable arguments. The number of inlets is determined by how many different changeable arguments are typed in. The maximum number of inlets is 9.send [symbol]
No commas or semicolons are allowed. Messages can be sent to remote receive objects by preceding the message expression with send, followed by the name of the receive object.
out2 [symbol]
The keyword if object. If precedes a message expression, the result of the expression is sent out the right outlet instead of the left outlet.
in a message expression creates a second, right outlet for theAttributes
Common Box Attributes
Messages
bang
int
Arguments
(inlet1)
Arguments
(inlet2)
Arguments
(inlet3)
Arguments
(inlet4)
Arguments
(inlet5)
Arguments
(inlet6)
Arguments
(inlet7)
Arguments
(inlet8)
Arguments
(inlet9)
Arguments
float
Arguments
(inlet1)
Arguments
(inlet2)
Arguments
(inlet3)
Arguments
(inlet4)
Arguments
(inlet5)
Arguments
(inlet6)
Arguments
(inlet7)
Arguments
(inlet8)
Arguments
(inlet9)
Arguments
set
Arguments
symbol
Arguments
Output
anything
The message after the receive object, and the message that follows it will be sent to receive objects with that name.
or portion of the arguments is sent out the outlet. If the word is present as an argument, there will be two outlets, and messages following will be sent out the right outlet. If the word is present as an argument, the word that follows it is the name of aSee Also
Name | Description |
---|---|
!= | |
< | |
<= | |
== | |
> | |
>= | |
expr | |
select | |
Max Basic Tutorial 22: Designing Equations | Max Basic Tutorial 22: Designing Equations |