I am trying to output a list of strings (ie char **strings) from a list outlet. I have a t_atom *a_vec that is as long as the number of strings that I want to output and there is a max length to the strings. My question is, how do I pack the strings into the atom vector(a_vec)? It's easy with float data: for(i=0;i<whatever; i++) SETFLOAT(a_vec+i, data[i]);
and then a_vec can be pushed out using outlet_list, and there it is.
It seems like I need to use the SETSYMBOL macro to do the equivalent with strings, but I'm not sure how to pack the strings into symbols correctly. Is there a method or a macro for this? Thanks, David
On 13/01/15 23:51, David Medine wrote:
how to pack the strings into symbols
gensym() turns a string into a symbol (so pointer equality can be used instead of string comparison)
note that there is no way to remove a symbol once it's added to the global symbol table.
if you're doing a lot of string processing, perhaps do it all inside a pdlua or some other scripting external, instead of passing strings as symbols through pd patch cords.
I begin to understand. Thank you!
On 1/13/2015 4:19 PM, Claude Heiland-Allen wrote:
On 13/01/15 23:51, David Medine wrote:
how to pack the strings into symbols
gensym() turns a string into a symbol (so pointer equality can be used instead of string comparison)
note that there is no way to remove a symbol once it's added to the global symbol table.
if you're doing a lot of string processing, perhaps do it all inside a pdlua or some other scripting external, instead of passing strings as symbols through pd patch cords.
Claude