String array?

Non-platform specific questions.

String array?

Postby Novice » Thu Jan 05, 2006 7:34 pm

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
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Thu Jan 05, 2006 8:01 pm

May be RandNum it's the index for a empty string.
Make sure initialize all strings that you need.
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Novice » Fri Jan 06, 2006 7:43 pm

Ok i made it work but i put the names in the create actor instead of global code.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron