Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-02-2013, 01:16 AM   PM User | #1
Taro
Regular Coder

 
Taro's Avatar
 
Join Date: Oct 2011
Location: Geraldton, Ontario
Posts: 155
Thanks: 1
Thanked 1 Time in 1 Post
Taro is an unknown quantity at this point
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.
Taro is offline   Reply With Quote
Old 01-02-2013, 04:00 AM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,042
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
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
oracleguy is offline   Reply With Quote
Old 01-20-2013, 01:32 PM   PM User | #3
AceInfinity
New Coder

 
Join Date: Jan 2013
Location: Canada
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
AceInfinity is an unknown quantity at this point
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.
AceInfinity is offline   Reply With Quote
Reply

Bookmarks

Tags
basic, ini, store

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:14 PM.


Advertisement
Log in to turn off these ads.