Autor Beitrag
Arne Danikowski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 194



BeitragVerfasst: Mi 24.01.07 18:53 
Hi,

folgende Aufgabe möchte ich realisieren:

Den Inhalt einer Listbox in eine Variable laden
den inhalt einer Variablen wieder in eine Listbox ausgeben.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
public
    { Public-Deklarationen }
  liste1,liste2 :TStrings;

procedure TForm1.FormCreate(Sender: TObject);
begin
  
     liste1 := TStringList.Create;
     liste2 := TStringList.Create;

procedure TForm1.Button1Click(Sender: TObject);
begin
liste1:=Listbox1.Items;
Listbox1.Items.clear;
Listbox1.Items.add (liste1);


Nun habe ich das Problem mit
ausblenden Delphi-Quelltext
1:
Listbox1.Items.add (liste1);					


String und TString sind nicht kompatible

jemand ne Idee wie ich das lösen kann?

mfg

Arne
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Mi 24.01.07 19:43 
also.
liste1 ist vom typ TSTrings. TSTrings ist eine Liste.
ListBox1.Items.Add(Item:String) Möchte für Item einen String (also eine Buchstabenfolge) und keine Stringliste!
Vll ist das was du suchst : ListBox1.Items:=Liste1;

Mfg Fighter#1

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
Arne Danikowski Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 194



BeitragVerfasst: Do 25.01.07 21:28 
Vielen Dank für die Antwort habe es hinbekommen