Count with incdec

The incdec object is a user interface object with an up arrow and a down arrow. It stores a number, and it also has an internal step size (increment attribute), which is 1 by default. When you click on the up or down arrow, incdec will increase or decrease its internal value by the increment, and send out the number. You can link it to a number box with a patch cord going to and from the number box, so that the number box always shows the current value of the incdec and the incdec will be updated if the user changes the number box, as shown in this example. You can also use the messages inc and dec to simulate the behavior of a mouse click on the up or down arrow.

Chapter: 
Keywords: