Hey,
I've got a problem with a tiny utility I wrote that uses an INI file to store entries for a list box. The program uses a normal loop to scan for entries, and exits when it reaches the end.
I added a new feature to it to remove redundant entries off the list, and reshuffle the INI file by moving all the entries backwards one section.
Sections are stored as follow:
[0]
variable=text0
[1]
variable=text1
[2]
variable=text2
[3]
variable=text3
At the moment, the function (say I remove Sec1 info) will resort the file to look like this:
[0]
variable=text0
[1]
variable=text2
[2]
variable=text3
[3]
variable=
I just need a procedure that I can tell it to look for "[3]" and remove everything in the file from that line onwards (including that line). After the truncate the file should look like this:
[0]
variable=text0
[1]
variable=text2
[2]
variable=text3
I've looked everywhere, but can only find info on the normal truncate function in Delphi- no examples of something like this.
Can anybody help me out please?
Thank you in advance.
I've got a problem with a tiny utility I wrote that uses an INI file to store entries for a list box. The program uses a normal loop to scan for entries, and exits when it reaches the end.
I added a new feature to it to remove redundant entries off the list, and reshuffle the INI file by moving all the entries backwards one section.
Sections are stored as follow:
[0]
variable=text0
[1]
variable=text1
[2]
variable=text2
[3]
variable=text3
At the moment, the function (say I remove Sec1 info) will resort the file to look like this:
[0]
variable=text0
[1]
variable=text2
[2]
variable=text3
[3]
variable=
I just need a procedure that I can tell it to look for "[3]" and remove everything in the file from that line onwards (including that line). After the truncate the file should look like this:
[0]
variable=text0
[1]
variable=text2
[2]
variable=text3
I've looked everywhere, but can only find info on the normal truncate function in Delphi- no examples of something like this.
Can anybody help me out please?
Thank you in advance.