Hi guys, I'm makeing a Homework "tracker", which is basically a day planner. I need help making a settings file for the initial setup. I have a text box, a couple radio buttons, and one "begin" button. I need a way for the program to remember what choices were seleced. Prefereably a way to put a text file in the programs' root folder. Any help would be great.
Thanks in advance,
TSims11

Recommended Answers

All 6 Replies

Then you need to have a file in the root directory and use the fstream library to read from it and write to it. When the user clicks one of the buttons or whatever, you'll have a function that is called and figures out what to read/write based on whatever (the state of the buttons, I guess). Figure out how you want that to be represented in the file and write to it/read from it using fstream.

Second page already? Come on guys I really need help... I know I'm a noob...

So I could just write a text file and make it have the certain settings?

So I could just write a text file and make it have the certain settings?

>> Prefereably a way to put a text file in the programs' root folder.

Yes. That's the goal, right? Figure out what you want to have in the file, then when the program starts, read the file and stick the file contents into whatever variables need them and then do whatever you need to do with them.

When the configuration changes, write to the file with the new settings.

Ok thanks. I though this might have worked but I didnt know for sure. Now to go find out how to word the syntax. haha. Thank you very much VernonDozier. I really appriciate the help. :)
-TSims11

Assuming this is an MS-Windows program you could put the settings in the registry, such as HKEY_CURRENT_USER/Software/<Your Program Name Here>. That way your program can get the settings regardless of where the program is on a computer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.