Sending forbidden characters to Text object ?

Jul 23, 2013 at 12:10am

Sending forbidden characters to Text object ?

Hi
My text format is something like this
open “terminal” 127.0.0.1; “OSC” 8997;
But when I send this to Text Object using cr command it filters these characters ” ;
open terminal 127.0.0.1 OSC 8997

My question :
is there a way to store these characters ” ; within Text object ?

Regards

#256842
Jul 23, 2013 at 1:24am

if you add a \ before each conflicting character it should do what you want. Plus, you can simply pass your entire string as one symbol thanks to the [tosymbol] object, maybe you should try this too ?

#256851
Jul 23, 2013 at 3:54am

The characters aren’t “forbidden”, they just have special meaning in Max. Quotation marks serve to delimit symbols with embedded spaces. Symbols that don’t have embedded spaces don’t need quotation marks, so the Max parser loses them for you. It may not seem like a feature, but it is (sorta).

There are a lot of other special characters (commas, semicolons, dollars, etc.) It’s important to be aware of these otherwise you’re going to get tripped up by other things.

The backslash has the special meaning of “ignore the special meaning of the next character,” which can be useful (and is one of Vichug’s suggestions). However, if your text gets parsed multiple times by the Max engine, each parse operation will strip away a layer of backslashes. The upshot of this is that you may need to add multiple backslashes to get the effect you want in your patch. You may ultimately need to write something like open \\\\"terminal\\\\" 127. You may need to experiment to get this right.

#256866
Jul 23, 2013 at 3:41pm

This \ really helped
I used sprintf for my data manipulation but it seems it does not like \ specially when it comes with ,so I return to good old massage box and $ thing .

Thanks to your thoughts VICHUG and PETER its almost done the only thing is left is the annoying white space at the beginning of my two symbols .
any solution to get rid of that ?

Here is the patcher

<code>

– Pasted Max Patch, click to expand. –

</code>

#256969
Jul 23, 2013 at 4:36pm

The sprintf approach seems to work here and no issues with whitespace.

<code>

– Pasted Max Patch, click to expand. –

</code>

#256971
Jul 23, 2013 at 5:34pm

Ahh! Many thanks ,I totally forgot the symout

#256975

You must be logged in to reply to this topic.