Conditional statement in if/then/else form
Name | Type | Opt | Description |
---|---|---|---|
if | symbol | Obligatory. The arguments for the if object start with a conditional statement that uses the same syntax as expr. Refer to the description of the expr object for details. 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 (or does nothing in the case where no and second message expression have been typed in. |
|
then else | symbol | Message expressions are similar to what you type into a message box, with the following differences: | |
$i1 $f1 $s1 | symbol | You use | , , or instead of for changeable arguments.|
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 the
bang | In left inlet: Evaluates the conditional statement using the values currently stored. Any of the above messages in the left inlet will evaluate the conditional statement and send out the result. Any inlets which have not yet received a value have the value 0 by default. The number of inlets is determined by how many different changeable arguments are typed in. The maximum number of inlets is 9. |
|
int | input [int] |
The number in each inlet will be stored in place of the | or argument associated with it. (Example: The number in the second inlet from the left will be stored in place of the and arguments, wherever they appear.)
(inlet1) | input [int] |
Performs the same function as | .
(inlet2) | input [int] |
Performs the same function as | .
(inlet3) | input [int] |
Performs the same function as | .
(inlet4) | input [int] |
Performs the same function as | .
(inlet5) | input [int] |
Performs the same function as | .
(inlet6) | input [int] |
Performs the same function as | .
(inlet7) | input [int] |
Performs the same function as | .
(inlet8) | input [int] |
Performs the same function as | .
(inlet9) | input [int] |
Performs the same function as | .
float | input [float] |
The number in each inlet will be stored in place of the | or argument associated with it. The number will be truncated by a argument.
(inlet1) | input [float] |
Performs the same function as | .
(inlet2) | input [float] |
Performs the same function as | .
(inlet3) | input [float] |
Performs the same function as | .
(inlet4) | input [float] |
Performs the same function as | .
(inlet5) | input [float] |
Performs the same function as | .
(inlet6) | input [float] |
Performs the same function as | .
(inlet7) | input [float] |
Performs the same function as | .
(inlet8) | input [float] |
Performs the same function as | .
(inlet9) | input [float] |
Performs the same function as | .
set | set-input [list] |
In left inlet: The word | , followed by one or more numbers, treats those numbers as if each had come in a different inlet, replacing the stored value with the new value, but the conditional statement is not evaluated and nothing is sent out the outlet. If there are fewer numbers in the message than there are inlets, the stored value in each remaining inlet is left unchanged.
symbol | input [list] |
In left inlet: The word | , followed by a symbol (a word), will be stored in place of the argument.
Name | Description |
---|---|
!= | Compare two numbers, output 1 if they are not equal |
< | Is less than, comparison of two numbers |
<= | Is less than or equal to, comparison of two numbers |
== | Compare two numbers, output 1 if they are equal |
> | Is greater than, comparison of two numbers |
>= | Is greater than or equal to, comparison of two numbers |
expr | Evaluate a mathematical expression |
select | Select certain inputs, pass the rest on |
Max Basic Tutorial 22: Designing Equations | Max Basic Tutorial 22: Designing Equations |