Page 1 of 1

Quick loadVars question

PostPosted: Sat Jan 07, 2006 4:33 pm
by plinydogg
Hi everyone,

I've got two quick questions. When using loadVars, do the values loaded need to be assigned to other variables? In other words, is it sufficient to code

loadVars ("game.save", "high scores");

or must one instead code

loadVars ("game.save", "high scores");
strcpy(somevariable, oneoftheloadedscores);


In other words, does loadVars load every variable in the file into memory or does it merely make them ready for assignment to other variables?
*******************************
Also, I read on the forum somewhere that we need to make sure that string variables are initialized. I know what it means to initialize (give a variable some value when its created), but I'm not sure how to do this with strings. With integers, it's a simple

int number = 0;

But what is the "int" equivalent for strings?

Thanks in advance!

PostPosted: Sat Jan 07, 2006 9:57 pm
by Joshua Worth
Once you make a group with variables in it, and use saveVars you can just load them back in with loadVars, no assigning to be done!

PostPosted: Sun Jan 08, 2006 12:28 am
by plinydogg
Thanks for the response. That's good to know....but it's also bad because that means that I have no idea why my high score list won't work :?

PostPosted: Sun Jan 08, 2006 12:45 am
by Joshua Worth
can you give me an example of what you are trying to do?

PostPosted: Sun Jan 08, 2006 4:42 pm
by plinydogg
Actually, for some reason, everything works fine now! Thanks for the help!