Forums > MaxMSP

sprintf formatting with quotes

June 10, 2013 | 10:17 am

I am attempting to create an instance of sprintf that always formats a section of the message with quotations around it

right now I have this as my sprintf object
sprintf script newobject newobj @text "%s" @patching_rect 20. 500. 50. 20. @varname icecreamery222

BUT the problem with this is even though I type in "%s", after I click outside of the sprintf object it reduces the "%s" to %s, how can I format this/use sprintf in such a way that it will preserve the quotation marks? I can’t use the symout argument as this will put quotations around the entire string when it only need have quotes around a chunk in the middle of the message


June 10, 2013 | 10:34 am

a symbol only has the double quotes when there’s a space, so "%s" shouldn’t exists. You can just combines the strings with prepend/append.

<code>

– Pasted Max Patch, click to expand. –

</code>


June 23, 2013 | 11:32 pm

hey thanks.. this is exactly what I needed.


April 4, 2014 | 2:52 pm

I am trying to send a long list of numbers through OSC and "tosymbol" only accepts 256 chars at the timje. Is there a way to add quotes to large lists?

Thanks


Viewing 4 posts - 1 through 4 (of 4 total)