Sry, dat ich nit früher antworten konnt, ming I-net war seit 10 aus
![Confused](images/smilies/icon_confused.gif)
.
Hatte das eben auch schon geänert, aber das bringt mir nichts, da es ne
Exception gibt, wenn ich die Procedure zum 2. mal aufrufe(die Wird in ner Rekursiven Procedure mit aufgerufen) und auf die Variable zugreife(also z.b. Kompo.Left)
Edit: Beim 2. durchlauf wird Kompo irgendwie nil, nur wieso versteh ich nicht, da dürfte doch eigentlich kein unterschied sein.
Jetzt sieht der Text so aus (beim 2. Durchlauf ist Kompo=nil)
Delphi-Quellcode:
var Kompo:TShape;
begin
Kompo:=(Findcomponent('im_st'+ InttoStr(Startstapel) + 'nr' + InttoStr(Stapel[Startstapel].Anzahl)) as TShape);
if(Kompo=nil)then
Showmessage('nil');
Showmessage(inttostr(3));
Kompo.Left:= Stapel[Zielstapel].left - (Kompo.Width div 2);// - (Findcomponent('im_st'+ InttoStr(Startstapel) + 'nr' + InttoStr(Stapel[Startstapel].Anzahl)) as TShape).width;
Kompo.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);
Showmessage(Kompo.name);