Einzelnen Beitrag anzeigen

Thorben86

Registriert seit: 20. Nov 2003
Ort: Brühl
365 Beiträge
 
Delphi 2005 Personal
 
#13

Re: Findcomponent löst Exception aus???

  Alt 13. Okt 2004, 20:32
Hmm, also bei einem durchgang klappt es irgendwie jetzt auf einmal. Bei dem 2. durchgang kommt jetz an der anderen stelle ne Exception .

Die Komplette FDunktion:
Delphi-Quellcode:
var Kompo:TComponent;
begin
Kompo:=TComponent(Findcomponent('im_st'+ InttoStr(Startstapel) + 'nr' + InttoStr(Stapel[Startstapel].Anzahl)) as TShape);
Showmessage(inttostr(2)); //Das wird noch angezeigt, dann kommt die Exct

(Findcomponent('im_st'+ InttoStr(Startstapel) + 'nr' + InttoStr(Stapel[Startstapel].Anzahl)) as TShape).Left:= Stapel[Zielstapel].left;

(Findcomponent('im_st'+ InttoStr(Startstapel) + 'nr' + InttoStr(Stapel[Startstapel].Anzahl)) as TShape).Top:= Stapel[Zielstapel].Top - (15 * (Anzahl+1)) ;

inc(Stapel[Startstapel].Anzahl,-1);
inc(Stapel[Zielstapel].Anzahl);
Kompo.Name:='im_st'+ InttoStr(Zielstapel) + 'nr' + InttoStr(Stapel[Zielstapel].Anzahl + 1);
end;
  Mit Zitat antworten Zitat