Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Textdatei erstellen / Umsetzung (https://www.delphipraxis.net/40967-textdatei-erstellen-umsetzung.html)

Grolle 23. Feb 2005 22:33


Textdatei erstellen / Umsetzung
 
Hallo!!!
Über Checkboxen sollen bestimmt Felder einer Datenbank in eine Textdatei
geschrieben werden. Hier der Quelltext:
Delphi-Quellcode:
begin
  SaveDialog1.FileName := pfad;
  if SaveDialog1.Execute then
  begin
  assignfile (f, SaveDialog1.FileName+'.txt');
 rewrite(f);
 Form1.table1.first;
while not Form1.table1.eof do
 begin
  Form1.table1.Indexname:='auswahlname';
  if CheckBox1.Checked = true then
  s:='' + Form1.Table1.FieldByName('Name').AsString +','+
  if CheckBox2.Checked = true then
  '' + Form1.Table1.FieldByName('Name').AsString +','+#13#10;
  WriteLn(f, s);
  Form1.table1.next;
 end;
 closefile(f);
 end;
Das mit der zweiten if Abfrage funktioniert so natürlich nicht.
Ich steh irgendwie auf'm Schlauch :lol:

sniper_w 23. Feb 2005 22:59

Re: Textdatei erstellen / Umsetzung
 
Hmm..hab nicht ganz verstanden...
Vielleicht so ?
Delphi-Quellcode:
while not Form1.table1.eof do
begin
  Form1.table1.Indexname:='auswahlname';
  if CheckBox1.Checked = true then
             s:=' ' + Form1.Table1.FieldByName('Name').AsString ;
  if CheckBox2.Checked = true then
            s := s + ',' + Form1.Table1.FieldByName('Name').AsString +','+#13+#10;
  WriteLn(f, s);
  Form1.table1.next;
end;

Grolle 23. Feb 2005 23:04

Re: Textdatei erstellen / Umsetzung
 
Ganz genau ! :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:45 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-2025 by Thomas Breitkreuz