Jaja, dyn. Arrays beginnen bei 0.
Nun funktioniert es. Vielen Dank
Delphi-Quellcode:
procedure TCsvDB.LoadFromFile(const fname: string);
var
s : TStrings;
i: Integer;
begin
try
s := TStringList.Create;
s.LoadFromFile(fname);
Header.Delimiter := Delimiter;
Header.StrictDelimiter := StrictDelimiter;
Header.DelimitedText := s[0];
headerCount := header.Count;
for i := 0 to linecount - 1 do
Content[i].Free;
lineCount := s.Count - 1;
setlength(Content,lineCount);
for i := 0 to lineCount-1 do
begin
Content[i] := TStringList.Create;
Content[i].Delimiter := Delimiter;
Header.StrictDelimiter := StrictDelimiter;
Content[i].DelimitedText := s[i+1];
end;
finally
s.Free;
end;
end;
Gruß
tr909