Sprintf %s %s %s

BasS's icon

Hello,

I hope someone knows an easy solution for this...

I want to combine a lot of information in one coll index.
But, when I use sprintf, there are no quotes around the symbols.
I need these quotes because one symbol can be one or more words.

And example is attached.

Kind regards,
Bas

Mike S's icon
Max Patch
Copy patch and select New From Clipboard in Max.

i imagine there is a more elegant way

BasS's icon

Hello Mike,

Thanks for your quick reply.
It works great, but the problem is that the information (like 8 numbers, words and lines) has to be in a specific order. It is collected in a different order from an user interface.

So unfortunately I can't make it work with 'zl join'.
The nice thing of sprintf is that I can collect all the info and the bang it through when inputting the index for the coll.

Kind regards,
Bas

Zachary Seldess's icon

How about [mxj list.Queue]?

best,
Zachary

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

Luke Hall's icon

Try putting the "quote" marks in the [sprintf] object, you'll need to escape them with the backslash character:

[sprintf "%s" "%s" "%s"]

lh

Mike S's icon

i thought there was a way with sprintf!

jml's icon

there is another way as well:
[sprintf symout %s %s %s]

this only works for single symbol output, though.

jml

BasS's icon

Thanks for all you replies!

This way works best for me "%s", since the order in which I put the information in is not 'from right to left'.
Although I realised it might be possible with 'pack' as well.

Kind regards,
Bas