Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post

    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.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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.
    OracleGuy

  • #3
    New Coder
    Join Date
    Jan 2013
    Location
    Canada
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •