AutoHotkey Community

It is currently May 27th, 2012, 12:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Simplify Read/WriteINI
PostPosted: July 15th, 2005, 9:45 am 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
Hi Chris,

I'm often working with ReadINI/WriteINI and I've heaps o' lines with them in my programs.
My suggestion: Introducing a special kind of variable that's made for INIs. The only special to that var would be a sign inbetween, e.g. the underscore. So you declare such a var like this:
Code:
header_item = %value%


Those vars would behave like normal vars until you write:

Code:
WriteINI, theINIfile.ini


Than all variables of the type a_b will flush into that mentioned INI.

After a program start you only write:

Code:
ReadINI, theINIfile.ini


And that's it. A bunch of vars is created, and filled with values. So you never can forget to save a value to an INI. My suggestion for another special character for signing those vars could be the ยง-sign, which we all should had (do we?). But the underscore is also not a problem unless you do a WriteINI. :)

Good idea?

Peter
(fan'o'AHK)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2005, 1:14 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
It's interesting but I don't think cost vs. benefit justifies building in a set of special variables and features solely for use with INI files. You could probably do something like this on your own by calling a function or subroutine whose job it is to build an array of pending data, which is later written as a batch to an INI file.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2005, 10:48 pm 
Offline

Joined: September 5th, 2005, 12:11 am
Posts: 10
Location: Zermatt, Switzerland
I agree with Chris -- I find reading/writing to ini files in AHK about as simple as it can get, and it makes writing scripts a lot easier than if you had to do all the file open stuff yourself.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group