A newer version of Max is available. Click here to access the latest version of this document.

message

Send any message

Description

message displays and sends any given message with the capability to handle specified arguments.

Arguments

Name Type Opt Description
any message list The initial contents of the message box are typed in when the patcher window is unlocked. Any message can be contained in a message box. Certain characters have special meaning.
$ and number (1 through 9) symbol and int A dollar sign ($), followed immediately by a number in the range 1-9, is a changeable argument. This argument's value can be replaced by the corresponding item in a list received in the inlet. (Example: $2 stores the second item in a list as its value before sending out the contents of the message box.) The value of a changeable argument is initially 0.
symbol A comma (,) divides a message into separate messages which will be sent out in order. (Example: 3, 4, 5 sends out 3, then 4, then 5.)
symbol A backslash (\) is used to negate the special traits of a special character. When a backslash immediately precedes a dollar sign, comma, or semicolon, the character is treated as a normal character. (Example: Notes played were C, E, and G.)

Messages

bang Sends out the contents of the message box. A mouse click on the message box has the same effect.
int input [int]
The number replaces the value stored in the argument $1, if such an argument exists, then sends out the contents of the message box.
float input [float]
The number replaces the value stored in the argument $1, if such an argument exists, then sends out the contents of the message box.
list input [list]
Each item in the list is stored in place of its corresponding $ argument, if such an argument exists, then the contents of the message box are sent out.
anything message [list]
Performs the same function as list.
append message [list]
The word append, followed by a message, appends that message (preceded by a space) at the end of the contents of the message box, without triggering output.
(mouse) A mouse click on a message box sends its contents out the object's outlet.
prepend message [list]
The word prepend, followed by a message, places that message (followed by a space) before the beginning of the contents of the message box, without triggering output.
set message [list]
The word set, followed by a message, sets the contents of the message box to that new message, without triggering output. The word set by itself erases the contents of the message box.
symbol input [symbol]
The word symbol, followed by a symbol, stores that symbol in the $1 argument, then sends out the contents of the message box.

Attributes

Name Type g/s Description
bgcolor float Sets the (upper) gradient color of the message box in RGBA format.
bgcolor2 float Sets the second (lower) gradient color of the message box in RGBA format. This attribute is enabled for editing in the Inspector by setting the usecolor2 attribute value to 1.
gradient int Toggles the use of a second gradient color applied to the lower portion of the message box. The default is 0 (off), although all message box objects show a slight amount of gradient shading. When the use of a second gradient color is enabled, the color2 (Second Gradient Color) attribute is enabled for editing in the Inspector.

Information for box attributes common to all objects

Menu Items

Name Description
Color Choosing the Color... menu item from the Object menu when the object is selected opens a color picker, permitting adjustment to the appearance of the message box.

Output

anything: The contents of the message box are normally sent out the outlet. If a semicolon is present, the rest of the message (or up to the next semicolon) is sent to the specified receive object, rather than out the outlet.

Examples

Send a simple message or construct a message of any degree of complexity

See Also

Name Description
append Append arguments at the end of a message
atoi Convert ASCII characters to integers
itoa Convert integers to ASCII characters
jit.cellblock Two-dimensional storage and viewing
prepend Put one message at the beginning of another
receive Receive messages without patch cords
Max Basic Tutorial 1: Hello Max Basic Tutorial 1: Hello
Max Basic Tutorial 2: Bang! Max Basic Tutorial 2: Bang!