Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi For-Schleifen-Problem (https://www.delphipraxis.net/103352-schleifen-problem.html)

Tommy1988 14. Nov 2007 17:15


For-Schleifen-Problem
 
Delphi-Quellcode:
Btn, item: TButton;
i, x: Integer;
Folgender Code funktioniert einwandfrei..
Delphi-Quellcode:
    for i:= 1 to 46 do
    begin
      Btn := TButton(Form1.FindComponent('TBXButton'+IntToStr(i)));
      if Btn <> NIL then Btn.Enabled:= True;
    end;
Der folgende jedoch unter der Meldung, dass TButton und TTBXItem inkompatibel sind, nicht.
Delphi-Quellcode:
    for x:= 1 to 5 do
    begin
      item := TTBXItem(Form1.FindComponent('TBXItem'+IntToStr(x)));
      if item <> NIL then item.Enabled:= True;
    end;
Was ist da falsch :oops:

Tommy1988 14. Nov 2007 17:15

Re: For-Schleifen-Problem
 
Fehler gefunden.!!!! wie kann man so Blöd sein !?!ß

Delphi-Quellcode:
Btn, item: TButton; // <--
i, x: Integer;

Dax 14. Nov 2007 17:16

Re: For-Schleifen-Problem
 
Delphi-Quellcode:
item: TButton;
Also Junge.. ;)

Tommy1988 14. Nov 2007 17:46

Re: For-Schleifen-Problem
 
Man kann sich mal mal verlesen :P

Ich hab den Fehler erst gesehen, als ich die Deklarationen hierhin kopiert habe :stupid:


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:19 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