construct message with comma's, without whitespace and backslash

Vjacobs's icon

Hello all,

I need to construct a message of 3 floats, divided by comma's. If I use sprintf and regexp, the output always adds backslashes before the comma. The ouput looks like 0.1,0.2,0.3 or 0.1, 0.2, 0.3 while I need 0.1,0.2,0.3. So, i don't want any whitespace nor backslashes in the output

How should this be done?

I added an example patch:

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

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

sprintf works just fine !
If I did understand correctly:

Am I wrong ?

Vjacobs's icon

Hello Ad,

tnx for your reply,

the problem is that I don't want any whitespace nor backslashes in the output. Your patch results in
0.1, 0.2, 0.3 while i need
0.1,0.2,0.3

I need this for constructing data to send to an OSC application that is not my own.

Grtz

timmb's icon

Don't have max open at the moment. Sprintf should do it but try using 'combine' which is a bit simpler:
combine f , f , f

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

Ah, just seen what's confusing you. The backslashes you see in a message box are just to let you know it's a single message. Route the output to a print object to see what's truly there (i.e. no backslashes).

Vjacobs's icon

ah yes indeed, stupid actually ;-)

tnx!

tep's icon

... stupidness again :

i need to get rid of the backslash.

Following these previous posts, indeed the message includes a backslash, but in the Max window we have the correct message we want : only comma, no backslash

But if i want to "truly" send this message into anything else - let's say, the [textedit] from Safairien example, the backslash remains everywhere...

Even if i try to send it manually in Safairien, Max window tells : "jweb : extra arguments for message "read"

...?

Did try with everything i could - regexp, sprintf, combine, [tosymbol] with @separator argument ...

But Max6 automatically removes the backslash in front of a comma, and i can't find the solution. Tiring.

keepsound's icon

Up, I have the same problem, just to visualize the messages (normal text using append) in textedit.

keepsound's icon

Using Textedit, set parameter mode on