![]() |
Re: Meine Drag'n'Drop-Funktion ergänzen
Du solltest aber trotzdem mal deine Freigabe der List2 überdenken.
Delphi-Quellcode:
//<--
List2:=Explode('=', List[i]);
ListBox1.Items.Insert(i, List2[1]); ListBox2.Items.Insert(i, List2[2]); ListBox3.Items.Insert(i, List2[3]); ListBox4.Items.Insert(i, List2[4]); List2.Free; |
Re: Meine Drag'n'Drop-Funktion ergänzen
Trotzdem finde ich solchen Code etwas optimistisch:
Zitat:
[edit] :lol: :cheers: [/edit] |
Re: Meine Drag'n'Drop-Funktion ergänzen
Hm... was genau? Verzeih, bin Hobbyprogrammierer. :gruebel:
|
Re: Meine Drag'n'Drop-Funktion ergänzen
Ne der Fehler war deswegen, eine .crp Datei wird mit
Zitat:
Zitat:
|
Re: Meine Drag'n'Drop-Funktion ergänzen
Delphi-Quellcode:
Oder wenn alles erfüllt sein muss:
List2:=Explode('<>', List[i]);
try if List2.Count > 1 then ListBox1.Items.Insert(i, List2[1]); if List2.Count > 2 then ListBox2.Items.Insert(i, List2[2]); if List2.Count > 3 then ListBox3.Items.Insert(i, List2[3]); if List2.Count > 4 then ListBox4.Items.Insert(i, List2[4]); finally List2.Free; end;
Delphi-Quellcode:
List2:=Explode('<>', List[i]);
try if List2.Count > 4 then begin ListBox1.Items.Insert(i, List2[1]); ListBox2.Items.Insert(i, List2[2]); ListBox3.Items.Insert(i, List2[3]); ListBox4.Items.Insert(i, List2[4]); end; finally List2.Free; end; |
Re: Meine Drag'n'Drop-Funktion ergänzen
Und wieso soll ich überprüfen, ob mehr als 4 Elemente vorhanden sind? :gruebel:
|
Re: Meine Drag'n'Drop-Funktion ergänzen
Weil Du anschließend auf das 5. Element zugreifst. Und wenn das nicht da ist, gibt es den von Dir beschriebenen Fehler.
|
Re: Meine Drag'n'Drop-Funktion ergänzen
Zitat:
|
Re: Meine Drag'n'Drop-Funktion ergänzen
*Gnarf* Probier das Folgende mal aus, dann weißt Du, was ich meine:
Delphi-Quellcode:
Liste := TStringlist.Create;
try Liste.Add('Hallo'); ShowMessage(Liste[1]); //es ist nur ein Element mit Index 0 (!!) vorhanden finally Liste.Free; end; |
Re: Meine Drag'n'Drop-Funktion ergänzen
:gruebel:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:41 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