Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Loading info and saving info to a file....

Author
Message
WillWorks88
21
Years of Service
User Offline
Joined: 25th Jun 2003
Location: United States
Posted: 10th Jul 2003 23:19
I'm trying to impliment an options menu into my game where the user can select what resolution they want to use in the game. And, to ensure the user doesn't need to re-select their preffered res everytime they enter the game, I want to save that info into a file called "settings.dat"

The user gets to chose between four different resolutions, and whichever one they choose is stored in a variable chosen_res. Which can range from 1-4. So, how do I save this one digit integer into a file, and then load it back up.

Check my code to see what I've already tried. (What happends is that it tries to save information, however when I load up the settings.dat file in NOTEPAD, all I see is a little Square... and no numbers?)

Thanks...
--- Only The Few Who Knew... Would Ever Reach Real True Blue
www.will-works.net
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 11th Jul 2003 00:32
after the first bit


what does chosen_res equal??? when you print it to the screen for instance??? you could try saving it as a string if you want to see it when you open it up in notepad

hi guys
Vulcan Omega
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United Kingdom
Posted: 11th Jul 2003 00:37
Hi there,

As ReD_eYe said you could save that value as a string. But because you have saved the value as a byte that's why it looks like that. So nothing to worry about.



I typed a quick example and works.

So I hope that helps ya.

Vulcan Omega is closer than you think !
http://www.vulcan-omega.co.uk/
WillWorks88
21
Years of Service
User Offline
Joined: 25th Jun 2003
Location: United States
Posted: 11th Jul 2003 04:26
Thanks guys.... its workin...

--- Only The Few Who Knew... Would Ever Reach Real True Blue
www.will-works.net

Login to post a reply

Server time is: 2024-11-24 22:31:42
Your offset time is: 2024-11-24 22:31:42