List: Replace Space with Comma?

Brantiko's icon

Hi!
I want to send three values from Sliders via a Serial Object.
Pak combines the values in a form like "255 24 145" but I need to seperate the values with a comma.

Thanks in advance for your Help

Brantiko

do.while's icon

Hi !

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

.
is it okay ?

Brantiko's icon

Thanks but.. when I put it through "tosymbol" the commas are gone again.

I tried to replace the 32 (ASCII Sapce) with 44 (ASCII Comma) after "atoi" and then convert it back but it seems as if max has some problems with commas as normal ASCII Letter.

Any Ideas?

Brantiko

do.while's icon

im not quite sure how to do this :/

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

i dont know about the serial , but cant you just send a list ?

Brantiko's icon

No! The device that waits for data needs to have a comma to seperate the values.

I will try your solution later...

Thanks,

Brantiko

bkshepard's icon

Does it NEED to be a symbol? Can you post a sample of what you are trying to do?

Peter Castine's icon

You need to be aware that inside Max the comma has a special meaning. You can't just insert commas into messages and expect everything else to continue as is. It's like dropping hydrochloric acid onto gold (don't try this at home with your wedding ring, kids).

If you want commas somewhere, you need to tell us exactly where and how and when.

If you're sending out to a serial device, probably the most appropriate way is to set up a list of ASCII codes and insert the integer 44 where you're wanting a comma.

But you're going to need to be a lot(!!!) more specific if you want specific help.

metamax's icon

I tried to replace the 32 (ASCII Sapce) with 44 (ASCII Comma) after “atoi” and then convert it back but it seems as if max has some problems with commas as normal ASCII Letter.

Are you printing your output or just looking at results in a message box? It seems like there is some confusion about the nature of symbols and/or the functionality of a message box. It's not really clear what you want... but it might look like 255\,24\,145 in a message box. That doesn't mean it will look like that to your device.

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