how to make $1 inside double quotes work / setting textbutton's text attribute

Jul 7, 2012 at 3:03pm

how to make $1 inside double quotes work / setting textbutton's text attribute

hello

when setting textbutton’s text attribute, it reads only the first word after word ‘text’.
so sending it message like [she ate $1 blotters] would set it to “she” word only
when i change it to ["she ate $1 blotters"] (quotes added), then the $1 will not work and text on button is set to “she ate $1 blotters” instead of “she ate 3 blotters”
how to find a way around this?
i tried escaping the spaces, but message [she ate $1 blotters] is automatically changed to ["she ate $1 blotters"] by max.
then i tried having [she ate $1 blotters] message separately, and prepending/appending or joining or combining with [text "] and ["] messages, which gave me correct output when checked using a connection to [print] object, but when connected to textbutton, the text attribute was set to:
“she
only. as if the ” were still escaped.

anybody has some idea please? how would you set text attribute of textbutton to something containing variable?

#37968
Jul 7, 2012 at 3:10pm
– Pasted Max Patch, click to expand. –
#131463
Jul 7, 2012 at 3:18pm

godbless ya! thanks

#131464

You must be logged in to reply to this topic.