Forums > Dev

char array as embedding attr


jml
May 5, 2010 | 11:56 pm

My obj has char array in its struct that is meant to be saved w/ the patcher in which the obj lives.
i am declaring it as an attr and calling CLASS_ATTR_VARSIZE and CLASS_ATTR_SAVE, but I notice when the attribute is saved w/ the patcher it is the full size of the buffer, regardless of the number passed as the 2nd to last argument of CLASS_ATTR_VARSIZE. Is there anything I can do to ensure that the number passed eliminates trailing characters?

Thanks for any help,
jml



jml
May 6, 2010 | 11:56 pm

This is the code that I cal in order to prepare the atom array to be saved:
CLASS_ATTR_CHAR_VARSIZE(c, "user-ints", 0, t_myobj, intbuf, intbuf_len, BUFSIZE);

Thanks
jml



jml
May 7, 2010 | 5:38 am

sorry; i meant char array, charbuf, and charbuf_len in my 2nd post. :s
word in the hills is that i need to write my own custom getter and setter… off i go!


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