Forums > MaxMSP

format string like xml attribute


mvf
December 4, 2013 | 3:56 am

Hi, does anybody know how to format a string in Max like this?
startSample="1320200"

I tried with combine, sprint, text object… All the time, the quotes are cleared.

Thank you very much for hints!


December 4, 2013 | 11:19 am

How about that?

<code>

– Pasted Max Patch, click to expand. –

</code>



mvf
December 4, 2013 | 1:56 pm

Hi Emmanuel, thank you very much. Funny, that you are using different quotes than me. I didn’t know that these "other" quotes exist.
I tried to use sprintf like this: sprintf startSample"%d" – in this way the quotes are deleted in object creation. Your quotes " are different (in this forum, the font seems to be the same for both types) – they stay there. I’m only not sure, if they’re accepted by XML parsers. I’m going to try it.
Thanks, Martin


December 5, 2013 | 4:08 am

I used straight double quote which is standard ASCII which is what XML wants AFAIK.



mvf
December 5, 2013 | 6:47 am

Normally I use shift+2 to get quotes on my (german) MB Pro keyboard. These quotes disappear after object creation. I have to use alt+2 to get your type of quotes, which stay in the object…Strange ;)


December 5, 2013 | 7:43 am

Emmanuel, a hypertext research for "straight double" doesn’t show any result on the Wikipedia page. Are you refering to the "quotation mark" (the first glyph in the table, code U+0022) ? If i copy paste that glyphe from wikipedia into replacing your pasted patcher quotes, they disappear… those seem to be the standard Max quotes, which are difficult to output from a sprintf box (best i succeeded :
<code>

– Pasted Max Patch, click to expand. –

</code>
)


December 5, 2013 | 9:08 am

well my bad… I must have fall asleep on the option key while doing that ;-) You have to escape the straight double quotes with a \.

<code>

– Pasted Max Patch, click to expand. –

</code>


December 5, 2013 | 3:24 pm

Oh, so [text] gets the quotes right ! THough it doens’t output them right… but that’s another problem maybe


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