Problem mit FindComponent
Hallo,
kann mir jemand sagen, warum das nicht geht?
Delphi-Quellcode:
Bin Ratlos?
While not mtdata.Eof do
Begin with TVCheckListBox(FindComponent('lst_ausstattung' + IntToStr(CAT_ID -2))) do begin // showmessage(mtData.FieldByName('Bezeichnung').asstring); // funktioniert Items.Add := mtData.FieldByName('Bezeichnung').AsString; // <= "Ungenügende Parameter" ?? end; mtdata.Next; end; |
AW: Problem mit FindComponent
Delphi-Quellcode:
?
Items.Add(mtData.FieldByName('Bezeichnung').AsString);
gruss |
AW: Problem mit FindComponent
Versuch mal
Delphi-Quellcode:
Items.Add(mtData.FieldByName('Bezeichnung').AsString);
Als Tipp noch, schmeiß dieses verpöhnte with raus! |
AW: Problem mit FindComponent
Zitat:
gruss |
AW: Problem mit FindComponent
DANKE!
Man sollte doch mal schluss machen;) Wie sollte es ohne with gehen? |
AW: Problem mit FindComponent
Zitat:
Zitat:
Delphi-Quellcode:
TVCheckListBox(FindComponent('lst_ausstattung' + IntToStr(CAT_ID -2))).Items.Add(mtData.FieldByName('Bezeichnung').AsString);
gruss |
AW: Problem mit FindComponent
Danke, konsequente OO;)
|
AW: Problem mit FindComponent
Zitat:
gruss |
AW: Problem mit FindComponent
So hintereinander gehängt ist es nicht mehr so gut lesbar. So sieht es so ähnlich aus wie mit with, nur besser lesbar (ab Delphi 10.3, davor muss die Variable vorher deklariert werden):
Delphi-Quellcode:
while not mtdata.Eof do
begin var CurrentListBox := TVCheckListBox(FindComponent('lst_ausstattung' + IntToStr(CAT_ID -2))); CurrentListBox.Items.Add(mtData.FieldByName('Bezeichnung').AsString); mtdata.Next; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:14 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