SRL Archive - Help

Iterate Keys in an INI file..


Brandon

2012-01-15 23:53:01

How can I get how many Keys are under a section in an INI file through Iteration?
I don't have a single clue how many keys are in the file but I know exactly what section to look under.

Edit Nvm.. Sorta found a temp fix:


SetLength(Food, 12);
For I:= 0 To 11 do
begin
Food[I]:= ReadINI('Food', 'Key[' + ToStr(I) + ']', ScriptPath + 'AZKInfo.INI');
end;
For I:= 0 To High(Food) do
begin
if (Food[I] <> '') then
J:= J + 1;
end;
SetLength(Food, J);

mormonman

2012-01-16 00:17:56

Store the count under a different key in the INI

Wizzup?

2012-01-16 05:52:32

You could alternatively use Simba's Settings API… I'm thinking of slightly modifying it so you can define your own file.