![]() |
StringGrid speichern
hallo,
habe das Problem, dass im Textfile ein Zeilenumbruch ausführt wird??? Warum??? Liegt es an CommaText?
Delphi-Quellcode:
wie bekomme ich die Hochkommas rausgefiltert?
procedure SaveStringGridToFile(StringGrid: TStringGrid; const FileName: String);
var F: TStringList; i: Integer; begin F := TStringList.Create; try F.Add(IntToStr(StringGrid.RowCount)); F.Add(IntToStr(StringGrid.ColCount)); for i := 0 to (StringGrid.RowCount - 1) do F.Add(StringGrid.Rows[i].CommaText); F.SaveToFile('Test.dat'); finally F.Free; end; end;
Delphi-Quellcode:
procedure TForm1.GlobalExceptionHandler(Sender: TObject; E: Exception);
var i: integer; s: String; begin StringGrid2.RowCount := StringGrid2.RowCount + 1; for i := StringGrid2.RowCount - 1 downto StringGrid2.FixedRows + 1 do StringGrid2.Rows [i].Assign (StringGrid2.Rows [i - 1]); StringGrid2.Rows [StringGrid2.FixedRows].Clear; StringGrid2.Cells [1,1] := FormatDateTime ('dd.mm.yyyy', Now); StringGrid2.Cells [2,1] := FormatDateTime ('hh:nn:ss', Now); StringGrid2.Cells [3,1] := 'eGrid Server [Error]'; s:= E.Message; s := StringReplace(s,'´','',[rfReplaceAll]); StringGrid2.Cells [4,1] := s; end; |
AW: StringGrid speichern
Zitat:
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:55 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz