An Extension Nobody Asked For (SuperINI)
Hello,
It has been said many times recently that INI files are dead and that XML is the replacement. However, I have always liked INI files. They are so simple but they are structured enough to actually be useful.
Back when I used Jamagic I created an object called “Super INI” that could do a fair few things that the standard INI object could not. Listing the groups and items was the most important. This is a port of that object with a load of new features thrown in. Perhaps it will surprise you that there are so many things.
Whilst it is an object nobody asked for, and an object I suppose not many people really want, I think it will be useful to have it. I found in Jamagic that once Super INI existed, I started designing my programs around the extra features a bit. It did prove useful to me. Maybe this MMF version will prove useful to others in the same way.
This is a version that works for MMF1.5. I do tend to convert it to MMF2 but I thought it was worth showing you all now. It comes with a ‘tour’ that explains the main features of it. It would be nice if people had a read through of it and looked at the available actions and expressions and conditions and gave an opinion. It is too late for new features though I think.
I have left out the save object feature since I could not be bothered to write it if I just have to rewrite it for the MMF2 version (the same would apply for save global values, but being lazy hadn’t occurred to me at that point). Also the file size is quite big at the moment. Probably because I’ve included too many standard libraries. I will worry about that later. The filters in the file selectors are incorrect too. All the features did work at some point and still do unless I’ve broken them with the exception of Get Value, as mentioned in the notes text file that is in the ZIP.
Please give feedback!
Download
Re: An Extension Nobody Asked For (SuperINI)
Very cool
I look at it this afternoon.
Re: An Extension Nobody Asked For (SuperINI)
I don't have MMF1.5 on this computer so I haven't tried it yet, but can there be more than one group with the same name? This could be useful if for example you are making a level editor. Something that in XML would look like
Code:
<root><light radius=10 /><light radius=5 /></root>
would in "Super INI" look like
Code:
[light]
radius=10
[light]
radius=5
In applications that handle files (text editors etc) it could be useful to store the last accessed files, like
Code:
[lastfile]
filename=C:\file1.txt
[lastfile]
filename=C:\file2.txt
Re: An Extension Nobody Asked For (SuperINI)
From memory, - No you couldn't have two groups with the same name.
The ini search algrithm is quite simple, it looks for the first occurance of the group and then proceeds to do the writing to the group.
Re: An Extension Nobody Asked For (SuperINI)
The object itself does not allow multiple groups or items with the same name (as it does not make sense), however I have thought of the situtation and the "Repeat mode" setting can do what you like. What it does is renames duplicate items or groups. For instance:
[group]
item=1
item=2
item=3
Might be loaded as:
[group]
item=1
item.1=2
item.2=3
and then there is a function which easily searches for all items which are in the form X or X.n. The same can happen for groups.
To find out more about this go to the demo project, look at the tour and click the "Repeats" topic. The last page of that topic also has a little place you can experiment with the settings.
"The ini search algrithm is quite simple, it looks for the first occurance of the group and then proceeds to do the writing to the group."
I'm not sure what you are talking about? The search feature in SuperINI is this? I'm not sure what you are talking about with writing. *confused*
Re: An Extension Nobody Asked For (SuperINI)
I'm going to university on Saturday so I won't be about for a while afterwards I suppose. Does anyone have anything to say about it? Should it be converted for MMF2 for a bonus pack or just released as a MMF1.5 thingy?
Re: An Extension Nobody Asked For (SuperINI)
[]I'm going to university on Saturday so I won't be about for a while afterwards I suppose. Does anyone have anything to say about it? Should it be converted for MMF2 for a bonus pack or just released as a MMF1.5 thingy? [/]
You should convert it for MMF2 (or ask me to).
Re: An Extension Nobody Asked For (SuperINI)
> (or ask me to)
Joshtek, would you please to convert this extention to MMF2 for me? (I don't have MMF2)
Re: An Extension Nobody Asked For (SuperINI)
If nothing is gonna happen to this I'll just release it for MMF1.2 and 1.5.
Re: An Extension Nobody Asked For (SuperINI)
Quote:
Originally Posted by Jax
> (or ask me to)
Joshtek, would you please to convert this extention to MMF2 for me? (I don't have MMF2)
Sure. I'd need the source, tho.