AutoHotkey Community

It is currently May 27th, 2012, 7:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Small help file addition
PostPosted: March 22nd, 2006, 9:01 am 
Offline

Joined: July 16th, 2005, 11:39 am
Posts: 96
Upon finding out that one of my scripts would have problems due to the size limitations of .ini files, I wrote a series of functions that do the same thing as the Ini commands but usable with any plaintext file format and with a little extra functionality.

It dawned on me that with the Ini commands, the file extension has to be specified and it might be because IniWrite, etc., can already function with
other file types. I tested it and lo and behold I had spent the last few days reinventing the wheel. :oops:

The upside is that it gave me a foundation to hammer out an extended ini
(.xini) format that includes subsections and that will help me consolidate several data files into one in my journaling script. Also, it's been a great learning experience and I've come up with a couple of good helper functions that will save me some headaches in the future.

Before someone else does the same redundant thing that I at first did, could you make a note in the help file that the Ini commands also work with other plaintext files?

For my next trick, I'm going to invent a gaseous substance that when inhaled keeps the body alive. :)

_________________
“yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2006, 9:44 am 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
Just curious, what is the limit of an .ini file?

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2006, 10:08 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
I thought it was in the documentation, but I can't find it right now.
I think an INI file is limited to 64KB, the good old Win16 limitation, in times were x86 processors used segmented memory (64KB segments, IIRC).
I don't know if there is a limitation on the lenght of one line.
Other limitation: a value has to be on one line (or use a separator to be replaced by a newline).

@Dragonscloud: INI files are plaintext files...
I don't see why you consider you were reinventing the wheel if you overcome INI format limitations and extended it.
And indeed, these functions work with any file extension, it seemed obvious (see .INF and .REG files), since it is a format, but it may worth indicating it.
Also a little known fact is the use of ; as comment mark. I saw // too, in a Microsoft file, perhaps actually anything unexpected is just ignored...
Note that you can write multiline values, but you can't read them back.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


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: Bing [Bot], Yahoo [Bot] and 3 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