Autor Beitrag
McFarlane
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

WIN XP Prof.
Delphi 2005 PE, Turbo Delphi 2006, PHP (Eclipse)
BeitragVerfasst: Fr 06.10.06 21:36 
Tach,
ich will den Inhalt einer TListBox als Textdatei abspeichern, hab aber überhaupt keine Ahnung wie. (In der Suche hab ich nichts derartiges gefunden)
Da kann mir doch sicher jemand weiterhelfen?
thx, McFarlane
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 06.10.06 21:39 
Die Items einer TListBox liegen als StringList vor, und StringListen haben nen Befehl "SaveToFile".
Also kannste schreiben:
ausblenden Delphi-Quelltext
1:
ListBox.Items.SaveToFile('datei.txt');					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 06.10.06 21:39 
Eine ListBox hat wie der Name schon vermuten lässt, eine untergeordnete Liste, welche die Methode SaveToFile() besitzt.

ListBox.Items.saveToFile( '<dateiname'>);

_________________
Markus Kinzler.
McFarlane Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

WIN XP Prof.
Delphi 2005 PE, Turbo Delphi 2006, PHP (Eclipse)
BeitragVerfasst: Sa 07.10.06 10:18 
cool, Danke