Autor Beitrag
mmmichael
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 08.11.05 19:44 
Hallo! Ich habe folgendes Problem:

Ich suche mit findComponent Komponenten mit Namen von "F0_0" bis "F19_19".

dies tue ich in zwei verschiedenen prozeduren, nur: einmal klappts und einmal meint der compiler:
Zitat:
[Error] Unit1.pas(204): Undeclared identifier: 'findComponent'

Find ich doof, denn wenige zeilen vorher gings...
Hier mein quellcode:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
for i := 1 to Length(Antwort.Text) do begin
    y := IntToStr(StrToInt(y)+1);
    TPanel(findComponent('F'+x+'_'+y)).caption := UPPERCASE(Antwort.Text)[i];
    TPanel(findComponent('F'+x+'_'+y)).Color   := clWhite;
end; {Das hier geht einwandfrei!}
{...}
for i := 0 to 19 do begin
      for j := 0 to 19 do begin
      s := 'F'+IntToStr(i)+'_'+IntToStr(j);
      TPanel(findComponent(s)).Caption := '';
      end;
    end; {Hier kommt der Fehler, warum auch immer!}

Also ich werd da nicht schlau draus... :(
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 08.11.05 19:46 
Hallo!

Ist die Prozedur, in der es nicht klappt, eine Methode der entsprechenden Form?

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
mmmichael
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 08.11.05 19:52 
Oh verdammt, klar! Die erste schon, die zweite eben nicht! *vordenkopfschlag*
Tja, so einfach kann das Leben sein... :lol:
Vielen Dank für den Denkanstoss, jetzt geht es!