versuche jetzt hier weiter zu machen ....
Delphi-Quellcode:
TMemoryIniFile = Class(TStringList)
private
function getSectionIndex(aSection: String): Integer;
public
procedure WriteString(section: String; ident, value: String);
End;
function TMemoryIniFile.getSectionIndex(aSection: String): Integer;
var
i: Integer;
SectionStr: String;
begin
SectionStr := '[' + aSection + ']';
i := self.IndexOf(SectionStr);
if (i < 0) then
begin
self.Add(SectionStr);
end;
result := self.IndexOf(SectionStr);
end;
procedure TMemoryIniFile.WriteString(section, ident, value: String);
begin
self.Insert(getSectionIndex(section), ident + '=' + value);
end;
besserer Ansatz ?