Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi StringGrid spalte in .txt (https://www.delphipraxis.net/111678-stringgrid-spalte-txt.html)

Fussball-Robby 7. Apr 2008 19:49

Re: StringGrid spalte in .txt
 
Erstelle dir eine temporäre Stringliste (so wie du auch sGridL erstellt hast), lade in diese die Datei, füge die Einträge hinzu und speicher sie.

SaFu 7. Apr 2008 20:04

Re: StringGrid spalte in .txt
 
Also entweder stehe ich auf dem schlauch oder ich raffe es echt net

Wie soll ich die Zweite liste anhängen

Delphi-Quellcode:
procedure TForm7.Button1Click(Sender: TObject);
Var sGridL,sGridLTemp :TStringList;
begin
  try
   sGridL:= TStringList.Create;
   sGridL.Sorted:= true;
   sGridL.Duplicates:= dupIgnore;
   sGridL.AddStrings(StringGrid1.Cols[2]);

   sGridLTemp:= TStringList.Create;
   sGridLTemp.Sorted:= true;
   sGridLTemp.Duplicates:= dupIgnore;
   sGridLTemp.LoadFromFile('c:\Test.txt');
   StringGrid1.Cols[2]:= sGridL;

   sGridL.SaveToFile('c:\Test.txt');
   sGridL.Free;
  except;
    MessageDlgPos7('Fehler beim speichern',mtInformation,[mbOk],self);
  end;
end;

mkinzler 7. Apr 2008 20:07

Re: StringGrid spalte in .txt
 
Delphi-Quellcode:
   sGridL:= TStringList.Create;
   sGridL.Sorted:= true;
   sGridL.Duplicates:= dupIgnore;
   sGridL.LoadFromFile('c:\Test.txt');
   sGridL.AddStrings(StringGrid1.Cols[2]);
   sGridL.SaveToFile('c:\Test.txt');

SaFu 7. Apr 2008 20:16

Re: StringGrid spalte in .txt
 
Oh mann wieder zu Kompliziert gedacht :duck:

Danke


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:35 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz