School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,099 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,031 people online right now. Registration is fast and FREE... Join Now!




A seettings file

 

A seettings file

diego_pmc

28 Sep, 2009 - 10:18 AM
Post #1

D.I.C Head
**

Joined: 13 May, 2009
Posts: 125



Thanked: 6 times
My Contributions
I'm trying to find the best way to store some setting for my program inside a separate file; something like an INI file. So my question is, what kind of file should I use? I know there are some others besides INI, like XML for example, but XML files look too HTML-ish (I guess it's because they are designed for websites).

This is the kind of info I want to store inside the file:

QUOTE(INI style)
[FILE PATHS]
TEXT_PATH = data/text
MUSIC_PATH = data/music
IMAGES_PATH = data/images

[WINDOW NAME]
TITLE = Application
VERSION = v1.4


This post has been edited by diego_pmc: 28 Sep, 2009 - 10:19 AM

User is online!Profile CardPM
+Quote Post


bsaunders

RE: A Seettings File

29 Sep, 2009 - 01:35 PM
Post #2

D.I.C Addict
****

Joined: 18 Jan, 2009
Posts: 558



Thanked: 42 times
My Contributions
An INI file sounds like a good idea. Do you not want to use an INI file?
User is offlineProfile CardPM
+Quote Post

diego_pmc

RE: A Seettings File

1 Oct, 2009 - 05:06 AM
Post #3

D.I.C Head
**

Joined: 13 May, 2009
Posts: 125



Thanked: 6 times
My Contributions
I just want to choose the most well known/most used extension of this type of things, it doesn't matter which one. BTW, as I understand it, there is a special type of syntax specific to INI files? Like ; for comments, parameter types are placed between square brackets (e.g.: [FILE NAMES]), etc.
User is online!Profile CardPM
+Quote Post

Oler1s

RE: A Seettings File

1 Oct, 2009 - 12:10 PM
Post #4

D.I.C Addict
****

Joined: 4 Jun, 2009
Posts: 733



Thanked: 69 times
My Contributions
There's actually no set way of doing settings files. So you'll see everything from INI to XML to embedded databases to ad hoc formats.

INI files do have a specific syntax. They aren't arbitrary. On that note, there are libraries out there for handling INI files, so that should make your life easier. The same goes with XML as well. Get a tiny non validating parser and you'll do well. If it's large amount of information, maybe a database is a good idea (but unusual for a settings type of file actually). Adhoc, well, it's easy to hack together, harder for maintainability.
User is offlineProfile CardPM
+Quote Post

Aeternalis

RE: A Seettings File

2 Oct, 2009 - 10:47 AM
Post #5

D.I.C Regular
***

Joined: 13 Jul, 2009
Posts: 273



Thanked: 25 times
My Contributions
If your using .NET you will want to look at this: Application Configuration Files

QUOTE

like XML for example, but XML files look too HTML-ish


Get over it. XML is an industry standard now. Get used to using it.
Aet

This post has been edited by Aeternalis: 2 Oct, 2009 - 10:50 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 12:11PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month