Quick loadVars question

Non-platform specific questions.

Quick loadVars question

Postby plinydogg » Sat Jan 07, 2006 4:33 pm

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!
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby Joshua Worth » Sat Jan 07, 2006 9:57 pm

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!
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby plinydogg » Sun Jan 08, 2006 12:28 am

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 :?
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby Joshua Worth » Sun Jan 08, 2006 12:45 am

can you give me an example of what you are trying to do?
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby plinydogg » Sun Jan 08, 2006 4:42 pm

Actually, for some reason, everything works fine now! Thanks for the help!
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest