CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Computer Programming (http://www.codingforums.com/forumdisplay.php?f=21)
-   -   Saving and loading variables with .ini files (http://www.codingforums.com/showthread.php?t=285128)

Taro 01-02-2013 01:16 AM

Saving and loading variables with .ini files
 
Are INI files useful for storing variables, especially in a basic hex-style format? I'm working with file communication, where two executables interchangeably interact with a single .ini file. Basically I would create a script, particularly using C++ or GML, to create the configuration; a string, mv = 0;, is stored. Basically I would like to load the variable and have both applications first recognize it, then display it. Take note that the applications and the configuration file are separately made from each other but with the same programming language. The string is primarily the only thing that is involved in this process.

oracleguy 01-02-2013 04:00 AM

Yeah you can use INI files to do that. I personally would use XML instead for two main reasons:
  • If you write an XSD you can generate classes to represent the file and it makes it easier for serialization and deserialization.
  • There are lots of premade XML libraries for almost every language unlike for INI files.

AceInfinity 01-20-2013 01:32 PM

Serialization/Deserialization is one of the main benefits of XML, but XML can also store more complex and larger data than a true INI file, as an INI file has limitations to the data size that you're allowed to have per key I believe.


All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.