How to make comma separated list?

Brantiko's icon

Hi!

I want to add some Integers to a list, separated with a comma!

234,233,1,22 etc.

I want to use sprint to do that.

Unfortunately: sprintf %ld,%ld,%ld is not working because I need the comma as a normal symbol. sprintf %ld\,%ld\,%ld is not accepted by the sprintf object.

Any ideas?

I could make all integers to ASCI then append 44 (comma) und join them with the join object. But I want a better solution!

11OLSEN's icon

try double slash: %ld\\,%ld\\,%ld
O.

o s's icon

Hi, related question:

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

How do I handle commas in [text]?

11OLSEN's icon
Max Patch
Copy patch and select New From Clipboard in Max.

escape the comma like this \, or it'll tell the messagebox to iterate through a list of messages. Or send in a symbol. O.

Brantiko's icon

ah double slash works! Thanks! BUT how is this related to ANY MAX/MSP logic??? Magic Knowledge?

11OLSEN's icon

sometimes you have to escape the escape sign itself so it passes the sprintf in this case. O.