Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi [gelöst]TListBox.Assign(TStringList) = Zufalls Exception (https://www.delphipraxis.net/65603-%5Bgeloest%5Dtlistbox-assign-tstringlist-%3D-zufalls-exception.html)

markusj 18. Mär 2006 17:21


[gelöst]TListBox.Assign(TStringList) = Zufalls Exception
 
Hi,

ich hab mal (wieder) ein Problem:

Ich habe ein TListBox, der ich mittels Assign eine StringList zuweisen möchte ... so weit, so gut.
Wenn ich diese Anweisung ausführe, erhalte ich eine Zufalls-Exception.

Der Code:

Delphi-Quellcode:
Main.KeyBlockData.Items.Assign(KeyData);
Main ist meine Form, KeyBlockData meine ListBox, KeyData eine StringList

Wo liegt mein Fehler??? Ich hab genau die selbe Anweisung auf eine andere Listbox und die funktioniert Problemlos.
Ach ja: KeyData ist eine gültige Instanz, sie wird erst hinterher aufgelöst.

mfG

Markus

EDIT: Das Problem wurde offenbar durch eine StringList.Capacity := integer verursacht ... komisch, aber das Problem ist gelöst.


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:35 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz