Symbol consisting of number

bolau's icon

Hi all,

I use the following code to generate a message in the C SDK:
t_atom msg[1];
atom_setsym(msg, atom_getsym(argv+1));

long k = 2;
char buffer[255];
sprintf(buffer, "%ld", k);
outlet_anything(x->m_outlet1, gensym(buffer), 1, msg);

The generated message looks like this:
"2" test

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

What can I do to avoid the quotes? I would like to use the message in a [route 1 2 3 4] style. It seems possible to have messages starting with numbers without quotes:

Am I missing something here?
Thanks for any help!
Best, Boris

bolau's icon

Works like a charm :)
Thanks Nicolas!

Peter Castine's icon

The alternative would be to pass the symbolized number through a [fromsymbol] object in your patch. But Nicolas' approach (which I would also recommend) is much more to the point. Why turn a number into a symbol if what you want is the number, right?-)