How do I add items to a list?

estevancarlos's icon

I'm creating a patch that at a certain part sends out numbers based on using an integer number (so you can drag it up and down to change it). I want these numbers to be added to a list. I want the list to get longer as the integer changes.

For example if someone scrolls through the numbers 30,31,32,33 then I want the list to contain 30,31,32,33. If someone then types the number 40, I want the list to then be 30,31,32,33,40. I don't think(?) I care about the order. I also want to be able to clear the list by sending it a message.

How do I go about doing this? I can't tell what object to use.

Mark Durham's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Maybe like this?

If you need to do any more with the list the zl. range of objects are super useful, check the help file for all sorts of list processing options.