route

Selectively pass the output out a specific outlet

Description

The route object takes a message and tries to match its first argument to the route object's own arguments. The rightmost outlet passes any message that matched no other choice, so you may gang route objects to get more choices

Arguments

Name Type Opt Description
outlet-format-initialization anything opt Arguments can be a mix of ints, floats, or symbols. The number of arguments determines the number of outlets, in addition to the rightmost outlet. Each argument assigns a name or a number to an outlet. If there is no argument, there is one other outlet, which is assigned the number 0.

Messages

bang Performs the same function as anything.
int input [int]
Performs the same function as anything.
float input [float]
Performs the same function as anything.
list input [list]
Performs the same function as anything.
anything input [list]
If the first item of the message is the same as one of the arguments of route, the rest of the message is sent out the outlet that corresponds to that argument. If the first item does not match any of the arguments, the entire message is passed out the rightmost outlet.

Information for box attributes common to all objects

Output

anything: The first item of any message received in the inlet is compared with the arguments. If it matches one of the arguments, the rest of the message is sent out the specified outlet. Otherwise, the entire message is passed out the rightmost outlet.
bang: If the first item of a message matches one of the arguments, but the message has no additional items, bang is sent out the specified outlet.

Examples

Arguments assign names or numbers to the outlets and route the input to the correct outlet

See Also

Name Description
bucket Pass a number from outlet to outlet, out each one in turn
forward Send remote messages to a variety of objects
gate Pass the input out a specific outlet
pack Combine numbers and symbols into a list
receive Receive messages without patch cords
select Select certain inputs, pass the rest on
send Send messages without patch cords
sprintf Format a message of words and numbers
zl Multi-purpose list processing
Max Basic Tutorial 18: Data Collections Max Basic Tutorial 18: Data Collections