Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Noods

Text Sorting

This topic is 5476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, now that I can open a file, I need to know where to look to figure out a reliable way to sort text. I can open and read a file with CreateFile and ReadFile, but how to find the items Im looking for is eluding me. Im basically looking to read a config file to set preferences for the program/interface, similar to how an MMORPG does. Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Do you mean as in searching the text file for certain data and then to act upon it or am I way off subject?

Share this post


Link to post
Share on other sites
You are right on the money BlueDev

Basically I would like to have different preferences that can be asved when a program exits, and then retreived when the program starts back up. If you could show me how to find a certain item in a file and then manipulate it into a variable, that would be all I need

Thanks Blue, you rock!

[edited by - Noods on August 18, 2003 1:07:31 AM]

Share this post


Link to post
Share on other sites
Ok, good. Sure I''ve written a program just like that before so i''ll write an example of it so you can see and learn how to do it. I should be finished with that by tommorow or Monday but if really pushing it Tuesday but in the mean time Good Luck!

- BlueDev

Share this post


Link to post
Share on other sites
If you are using windows, you can use ini files.

The winapi has functions for that, look at the GetPrivateProfile* functions in msdn. This works fine unless you want something more advanced.

Share this post


Link to post
Share on other sites
ini files are deprecated, you''d better use the registry (RegCreateKey, etc).
Btw, if it''s some mmorpg, just store the settings in the game database.

Share this post


Link to post
Share on other sites
quote:
Original post by mputters
ini files are deprecated, you''d better use the registry (RegCreateKey, etc).
Btw, if it''s some mmorpg, just store the settings in the game database.


That might be what Microsoft says, but there''s still a lot of applications coming out every day that uses ini files, so Microsoft can''t go and remove the support for those functions, no matter what they say. Also a program should never store a lot of information in the registry, I once had win2k stop booting, because the registry was too big!!!

The other advantage ini files have is that you can move the game directory anywhere and back it up for example, and save your settings, most people forget to backup info stored in the registry, or they back it up, but don''t know how to restore what they need from the backup...

Ok, the registry have some advantages like being multiuser, but windows has special user directories in "Documents and settings", so you can store the ini file there, and have the same advantage. In addidtion most users back up that directory.

And Microsoft still use settings files themselves, I just checked documents and settings for visual studio 2003. But that''s not ini files, xml and dat, but the purpose is the same.

Yes, that''s of course another alternative for you, to use xml files and an xml library. But xml libraries tends to be a bit hard to use until you get a hang of it.

Share this post


Link to post
Share on other sites
I need to create ini file as well but i don''t got MSDN for reference,anyone knows a good tutorial?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!