Editing/Appending to files

For questions about using Classic.

Post » Sat Oct 23, 2010 11:07 am

I'm using the INI file object to store values in a text file. I can't seem to find any Actions associated with it so that I can edit/append the ini file. I don't want to use Write as it overwrites the previous stuff.
Also, how do you read these ini files?
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Sun Oct 24, 2010 1:15 am

Inis have groups and values.
if you open an exisiting ini file with the ini object and write a new value, it will be appended.
if you write an existing value, the previous will be overwritten.
you may NOT use the same value twice within a group, as it doesn't make any sense.

You may check before you write, and see if the value is there. This would in fact let you know if you were about to overwrite a value that was previously there.

If you plan to treat ini files as strings (which is absolutely unnecessary) you could try the binary object instead.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Oct 24, 2010 10:11 am

Thanks for the reply. I have a few more questions regarding INI objects:

1. Let's say I don't know the name of the group but I want to access the nth group in the ini file, how do I get the group number? Or is there some other way to refer to a group?

2. How do you sort an ini file according to the values of 1 of the items? (Assuming all groups have an item in common.)
B
5
S
1
G
3
Posts: 59
Reputation: 993


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests