Delphi-Quellcode:
rocedure TForm1.ffnen1Click(Sender: TObject);
var
F: TStringList;
i,j: Integer;
begin
if not opendialog1.execute then exit;
F := TStringList.Create;
try
with StringGrid1 do
begin
F.LoadFromFile(OpenDialog1.FileName);
RowCount := StrToInt(F[0]); // Zeilen
ColCount := StrToInt(F[1]); // Spalten
Edit1.Text := F[1];
Edit2.Text := F[0];
for i := 0 to (RowCount - 1) do // Zeilen M1
Rows[i].CommaText := StrtoInt F[i+2];
// 1.Versuch
for j := 0 to F.itemsCount - 1 do
begin
rows[j]:= StrToInt(F.Items[j]);
end;
//2.Versuch
for j := 0 to F.itemsCount - 1 do
begin
integerarray[j]:= StrToInt(F.Items[j]);
end;
//3.versuch
for j := 0 to StringListe.Count -1 do
begin
rows[j] := StrToInt(F.Strings[j]);
end;
end;
finally
FrreAndNil(F);
end;
end;
Das waren die dreiversuche, wobei keiner funktioniert hat...