Autor Beitrag
Apo95
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Di 17.04.12 13:53 
Hallo,

kann mir jemand sagen, wie ich den Inhalt von 3 Listboxen als eine CSV-Datei sichern kann ( mit Dialog)?

LG,
Apo95

_________________
Lette-Verein MIA
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 17.04.12 14:14 
Soll dabei jede ListBox eine Spalte in der CSV darstellen?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var
  csv: TStrings;
  Line: Integer;
begin
  csv := TStringList.Create;
  try
    // geht so aber nur wenn alle ListBoxen gleich viele Einträge enthalten
    for Line := 0 to ListBox1.Items.Count -1 do
      csv.Add(ListBox1.Items[Line] + #9 + ListBox2.Items[Line] + #9 + ListBox3.Items[Line]);     
    csv.SaveToFile('C:\Datei.csv');
  finally
    FreeAndNil(csv);
  end;
end;

Für diesen Beitrag haben gedankt: Apo95
Perlsau
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 17.04.12 14:18 
Dann mach doch auch gleich eine Prüfung, ob die Stringlist-Counts gleich sind ...
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 17.04.12 14:27 
user profile iconPerlsau hat folgendes geschrieben Zum zitierten Posting springen:
Dann mach doch auch gleich eine Prüfung, ob die Stringlist-Counts gleich sind ...


Das kann er selbst schreiben ;-)
Perlsau
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 17.04.12 14:34 
user profile iconAndreas L. hat folgendes geschrieben Zum zitierten Posting springen:
Das kann er selbst schreiben ;-)


Sicher? Ich hab da meine Zweifel :twisted:
Apo95 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Di 17.04.12 22:27 
Funktioniert! Alles klar!

Moderiert von user profile iconNarses: Weitere Frage entfernt.

_________________
Lette-Verein MIA