quote:
Originally posted by JonnyT
What would be the best method, and how dyou do it, to store/save information for scripts. Things like settings/options, nicknames etc
Thanks J
There would be no 'best' method. It highly depends on what those settings actually are.
There are some methods you can use:
1) Saving data in not structured files
2) Saving data in INI files
3) Saving data in XML files
4) Saving data in the registry
For each there are benefits and drawbacks, and each can/should be used for specific scenarios. Which method you choose depends on many things, but in the first place the kind of data to be stored. eg:
1) Saving binary data or data which contains huge lumps of text, etc. Easly portable and easy to backup. Not easy to code, unless 1 file contains only 1 dataset.
2) Saving small settings which don't need complex structures. Easly portable and easy to backup. Can be reconized easly, read in an instant and edited by everyone. Difficult to work with in scripts as it doesn't support an INI structure by default.
3) Saving more complex data structures. Easly portable and easy to backup. Not so easy to see the actual settings at first glance as it contains lots of "special codes". Needs some amount of support code in your script.
4) Saving small settings or not so complex data structures. No files needed and thus not easly porteable. Not everybody knows how to manually edit it, etc. Though requires the least amuont of code in scripts.
Mostly you'll see that the registry is being used as that is the most ideal in many scripts.