On 01/09/2017 06:59 PM, Ricky Graham wrote:
Hi all,
I’d like to use atom_getsymbol to get some text from an object on creation.
atom_getsymbol() is used to get a t_symbol* from a t_atom*.
I’m using A_DEFSYMBOL
when using A_DEFSYMBOL, you don't deal with t_atom*s; instead you get a t_symbol* directly. so there is no use for atom_getsymbol()
for the moment and *s seems to print to console
??? how?
but I can’t seem to figure out how to get type t_symbol into an array.
into an array of what? this doesn't make sense (and i suspect that this is why it doesn't work for you)
atom_string seems to work with A_GIMME but that seems redundant as I’m only passing one symbol.
a symbol is a pointer to a "t_symbol" struct. the t_symbol struct has a member "s_name" which is a pointer to a zero-terminated immubtale string. most likely this is what you want.
since symbols are statically allocated, this pointer will remain valid through the process's lifetime. so most likely, you don't want to "copy it to an array", but rather keep the pointer around and use it directly. there's only one exception to this: if you want to modify the string, then you *must* copy it first.
gfmdsar IOhannes