Filter an INI (Part 2)

For questions about using Classic.

Post » Fri Jan 14, 2011 5:30 am

I asked this before and got a good answer [url:18celj7t]http://www.scirra.com/forum/viewtopic.php?f=3&t=7215&start=0[/url:18celj7t]

But the more I use it I'm sure if it will work...

What I need is to filter an INI file based on the value of certain items.

Like generate a list of all groups whose items "Faction" match and out of those, whose item "Class" matches.

Is this possible with Construct or python?
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Fri Jan 14, 2011 8:56 am

How about the following simple thing:

For each group, item class equal to "desired class", do stuff.

So you could have a filtered list of classes stored in a Hash Table for example. And then do something like For each key => INI group Hashtable.CurrentValue, ... you get the idea.

On a serious sidenote you would want to limit the number of file operations when dealing with inis. Ideally you'd only check stuff from the INI once on startup. If you need to check back often, you should just load the groups and items from the ini into values. The S plugin can be handy for this. Also as a complete replacement for INI in many cases.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Jan 14, 2011 2:15 pm

How would I go about using the "S"?
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests