Forums > MaxMSP

Data type problem : both a string and a number into same inlet of a pack

Sep 20 2011 | 6:15 am


I’m trying to pack a string and a number into ONE inlet of a pack.

basically its either a number or the string "off" and I want to pack it into a list with other numbers…

obviously you cant do this with a pack object, since it only accepts either/or, so can someone please head me in the right direction?

Sep 20 2011 | 8:45 am

You could try converting the number to a symbol with the [tosymbol] object or you can avoid the packing by playing with the [prepend]/[append] objects.

Sep 20 2011 | 9:44 am

there are some objects that are often referred to in this context, namely the [zl] family and the [regexp] object. The latter may be a little arcane or unwieldy for this, but I’m not familiar with its use; prepend/append is probably easiest tho. Post a patch or excerpt and you’ll get instant suggestions.


Sep 20 2011 | 11:26 am


-- Pasted Max Patch, click to expand. --

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > MaxMSP