how to keep commas in a "one symbol" string?
Hi,
I'm trying to send strings from Max to Csound through UDP (I would like to read them from [text] and output them through [udpsend])
Those strings includes commas and they have to be sent as "one symbol" for not being truncated by [udpsend].
So, the output of [text] should pass through [tosymbol], but in this case I loose the commas...
How can I get out of this? I'm frustrated....
thanks!
Try this. There may be a more elegant way, but I think this is what you are talking about. The regexp in this case is changing a "," into ","
Thanks Mad jax for your reply, it almost works, but I still loose some of the commas ;)
sprintf is helpful here
Thanks Jesse, the problem is that each string is different in terms of % arguments position and lenght... ;-(
take care, you might simply exceed the lenght a symbol in max may have.
otherwise the general way is to first pack the separate messages into a list and then convert the list to a symbol.
the exception would be when there is a single comma among the input data. this can not even be sent out from anywhere ;)
If you have a variety of string lengths it will be harder, but you can prepend your input lists with a tag that you can then use to route to the appropriate sprintf formatter. This can make for cumbersome patches but at least you have a way to achieve it. A brief example below.