Page 1 of 1

String array?

PostPosted: Thu Jan 05, 2006 7:34 pm
by Novice
I have a bunch of names in a string array
Code: Select all
strcpy(Name[0],"Tom");
strcpy(Name[1],"Sally");
...

on mouse up event a random name should be printed in a text actor
Code: Select all
strcpy(textActor.text,Name[RandNum]);

but the text actor just disapears, what am i doing wrong?TIA

PostPosted: Thu Jan 05, 2006 8:01 pm
by makslane
May be RandNum it's the index for a empty string.
Make sure initialize all strings that you need.

PostPosted: Fri Jan 06, 2006 7:43 pm
by Novice
Ok i made it work but i put the names in the create actor instead of global code.