So, habs jetzt über die Stringlist gelöst:
Delphi-Quellcode:
function TIniAccess.writeDataToIni (inSSCategory, inSDescription, inSValue : String) : Boolean;
var
lInifile : TStringList;
begin
if fSPath = '' then setAppDir;
Result:=False;
if inSValue <> '' then
begin
try
ForceDirectories(Copy(fSPath, 0, LastDelimiter('\', fSPath)));
lInifile := TStringlist.Create;
if FileExists(fSPath) then
lInifile.LoadFromFile(fSPath);
if lInifile.IndexOf('['+inSSCategory+']') < 0 then
begin
lInifile.Add('');
lInifile.Add('['+inSSCategory+']');
end;
lInifile.Insert(lInifile.IndexOf('['+inSSCategory+']')+1,inSDescription+'='+inSValue);
lInifile.SaveToFile(fSPath);
Result:=true;
finally
lInifile.Free;
end;
end;
end;