Ist Deutsch deine Muttersprache?
Kannst du uns deinen bisherigen Quelltext zeigen?
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
var i:integer;
begin
savecsv(i,ExtractFilePath(ParamStr(0)) + 'Koordinaten.csv');
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
loadcsv(2,ExtractFilePath(ParamStr(0)) + 'Koordinaten.csv');
end;
procedure TForm2.savecsv(ID: integer; Filename: string);
var KPolygon:TStringlist;
Slist:Tstringlist;
Sl:Tstringlist;
csvtextlin:string;
i,j:integer;
begin
try
Slist:=Tstringlist.Create; Sl:=Tstringlist.Create;
for I := 0 to 3 do
KPolygon:=Tstringlist.Create;
for j := 0 to RichEdit1.Lines.count - 1 do
begin
csvtextlin:= RichEdit1.Lines[j];
KPolygon.Add(csvtextlin);
end;
Slist.AddStrings(KPolygon);
Slist.SaveToFile(Filename);
Showmessage(Slist.Text);
finally
KPolygon.Free;
Slist.Free;
end;
end;
procedure TForm2.loadcsv(ID: integer; Filename: string);
var KPolygon:TStringlist;
Slist:Tstringlist;
csvtextlin:string;
i,j:integer;
begin
try
Slist:=Tstringlist.Create;
Slist.LoadFromFile(Filename);
id:=Slist.count;
for I := 0 to id-1 do
KPolygon:=Tstringlist.Create;
if (KPolygon[i])=inttostr(id) then
for j := 0 to KPolygon.count - 1 do
begin
csvtextlin:= KPolygon.Strings[j];
end;
Showmessage(KPolygon.Strings[j]);
finally
KPolygon.Free;
Slist.Free;
end;
end;