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

knockd0ut's icon

Hello,

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?

$Adam's icon

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.

brendan mccloskey's icon

Hi
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.

Brendan

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

Sprintf?
cheers
Roger