Autor Beitrag
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 09.04.06 14:53 
Hallo Leute !
Hab da mal ein Problem, ich lese aus einem Stringgrid die Strings aus
und möchte gern vorn und hinten noch etwas anhängen aber in jeder Zeile.

zb. xyz.txt
abc.txt

Datei - xyz.txt - Neu !
Datei - abc.txt - Neu !

Vieleicht kann mir jemand auf die Sprünge helfen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.Button2Click(Sender: TObject);
var
MList: TStringList;
  i: Integer;
begin
  MList := TStringList.Create;
  try
    for i := 0 to (StringGrid1.RowCount - 1) do
     MList.Add('Datei - '+ StringGrid1.Rows[i].Text); {' Neu !'}
     Memo1.Lines:=MList;
  finally
    MList.Free;
  end;
end;
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: So 09.04.06 14:55 
Warum net einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.Button2Click(Sender: TObject);
var
MList: TStringList;
  i: Integer;
begin
  MList := TStringList.Create;
  try
    for i := 0 to (StringGrid1.RowCount - 1) do
     MList.Add('Datei - '+ StringGrid1.Rows[i].Text + ' Neu !');
     Memo1.Lines.Assign(MList);
  finally
    MList.Free;
  end;
end;
Blackheart666 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 09.04.06 15:10 
Das ist ja mein Problem wenn Ich nur einen Eintrag hätte würde das gehen aber bei mehreren schreibt er mir dann

Datei - xyz.txt
abc.txt
Neu !

Nachtrag
Habs jetzt gelöst mit einer zweiten Stringlist, trotzdem Danke!