comma problem

hmarstra's icon

Is there any way to insert a comma into a list for a message box?

If you have a list: 2000 0 100

Can you insert a comma after 2000 (2000, 0 100) so you can send it from a messagebox as a ramp for line~ ?

This is a problem I have come across many times
In this case I wanted to store a bunch of ramp messages in a coll object

0, 2000 0 100
1, 100 0 300
2, 4000 0 100
3, 2000 0 700
4, 300 0 600
5, 7000 0 400
6, 1500 0 200
etc

But coll lists can only take one commas pr line(after the indexnr), so I need to insert it after I have sent one list from coll

Guillaume Evrard's icon

hi,

Max Patch
Copy patch and select New From Clipboard in Max.

try something like this :

g

Tim Lloyd's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You can do it like this with sprintf. I've heard that combine is better to use for efficiency reasons, but I couldn't get it to work with a comma. Anyway, there is nothing to worry about at all unless you're using loooads of them. You could modify the patch by storing the chosen list for line in [zl reg ] and banging it when you want to trigger the ramp instead of every choice triggering it.

Tim Lloyd's icon

Ahh, go with GE's method. Much more elegant solution.

hmarstra's icon

oh, sorry for not mentioning. Im using 4.5 :( Any chance of posting in old format? (or short explanation)

hmarstra's icon

About your suggestion with zl reg. Sometimes it can be desirable to constantly generating 3 random values (startpoint, endpoint, ramptime) Then you need to be able to format it with comma on the fly. Thats another example of the comma problem with messagebox
..... but I will look into sprintf (or your patches in old format...)

Guillaume Evrard's icon

re-hi,

here is the max 4 format :

Max Patch
Copy patch and select New From Clipboard in Max.

g

hmarstra's icon

Solved it with sprintf, argument %c sending it asci nr 44 (comma) from a messagebox. Thanks
(Evrard, still curious about yours) ....... oh there it came while I was typing....
Ok, then I learned something new about coll formating. Thanks for that as well

Speaking of that: What is the asci nr for (backslash) Key object showed 92, but sprintf translated that into "

Luke Hall's icon

You could just store them as normal lists and then use [zl rot 2], [zl slice 2] and patch both outlets to the [line] object. The comma in a message box simply sends the contents one after another.

lh