Autor Beitrag
kronoide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Do 25.01.07 19:48 
hallo delphi freunde :wink2:

naja der titel sagt schon alles;
ich weiß auch wie man listboxen abspeichert aber ich weiß nicht wie man
zwei listboxen in eine txt datei abspeichert

danke schonmal :o
kronoide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Do 25.01.07 21:25 
hat den wirklich niemand eine idee??? :nixweiss:
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 25.01.07 21:28 
Moin!

Hmmm... :? Schiebepostings sind hier erst nach 24h erlaubt! :mahn: :| Und das ist nicht das erste mal, dass du etwas "ungeduldig" wirst! Bitte versuch das mal abzustellen, OK?! :evil:

Probier das mal so: ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var
  SL: TStringList;

begin
  SL := TStringList.Create;
  try
    SL.Add(ListBox1.Items.CommaText); // Items der 1. Listbox als CommaText
    SL.Add(ListBox2.Items.CommaText); // dito der 2. Listbox
    SL.SaveToFile('C:\ListBoxen.txt');
    ListBox1.Clear; // zur Demonstration leeren
    ListBox2.Clear;
    SL.LoadFromFile('C:\ListBoxen.txt');
    if (SL.Count >= 2) then begin // min. 2 Zeilen da?
      ListBox1.Items.CommaText := SL.Strings[0]; // Items der 1. Listbox wiederherstellen
      ListBox2.Items.CommaText := SL.Strings[1]; // dito der 2. Listbox
    end;
  finally
    SL.Free;
  end;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
kronoide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Do 25.01.07 21:38 
entschuldigung :oops: und ich werde das sicher beim nächsten mal bedenken :wink:
und danke für den code, funktioniert zu 100% :D
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 25.01.07 21:43 
Moin!

user profile iconkronoide hat folgendes geschrieben:
entschuldigung :oops: und ich werde das sicher beim nächsten mal bedenken :wink:

Ich hatte schon den Beitrag angefangen, als du geschoben hast... :? sonst hätte ich gar nicht erst geantwortet (du warst ja schon aus dem andern Thread gewarnt!)... :| Nunja, Schwamm drüber. ;)

user profile iconkronoide hat folgendes geschrieben:
und danke für den code, funktioniert zu 100% :D

Ich weiß. :P Trotzdem Danke. :zwinker:

Markierst du den Thread noch entsprechend, wenn dein Problem gelöst ist? Danke. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.