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

incdec

Buttons that increment/decrement a value

Description

incdec is a simple Increment/Decrement object for number boxes (click the upper half to increment, click the lower half to decrement).

Arguments

None.

Messages

bang A bang message causes the incdec object to output the currently stored value.
int input [int]
A number sent to the incdec object's inlet sets the value that will be incremented or decremented by clicking on the top or bottom of half of the object. The number is not sent out the outlet. incdec is designed to be used with user interface objects such as the number box, dial, and the various sliders.
float input [float]
A floating-point number sent to the incdec object's inlet sets the value that will be incremented or decremented by clicking on the top or bottom of half of the object. The number is not sent out the outlet. incdec is designed to be used with user interface objects such as the number box, dial, and the various sliders.
dec The dec message can be used to decrement and output the stored value.
inc The inc message can be used to increment and output the stored value.
(mouse) A mouse click increments or decrements the stored value (depending on which arrow is clicked) and sends it out the outlet.
set input [int]
The word set followed by an integer value functions identically to the int message, and is provided for convenience.

Attributes

Name Type g/s Description
bgcolor float Sets the background color.
bordercolor float Sets the border color.
fgcolor float Sets the foreground color.
increment float
def.:1.
Sets the step size for increment/decrement.

Information for box attributes common to all objects

Output

int: When you click on the top half of an incdec object, it sends out a value that is one greater than the last value received at its inlet or sent out its outlet, whichever happened most recently. Holding the mouse button down continues to increment the output, gradually increasing in rate of output.

The same is true for the bottom half of the incdec object , except that the values are decremented.

Examples

incdec works well in combination with number box and slider

See Also

Name Description
number Display and output a number
umenu Pop-up menu, to display and send commands
slider Output numbers by moving a slider onscreen