procedure Timer1OnInterval(sender : TObject); var tmpPercentDone: string; begin NextStep; Writeln('Current step: ' + IntToStr(CurrentStep) + '/' + IntToStr(TotalSteps)); PercentDone:= Trunc3((CurrentStep div TotalSteps) * 100, 2); Writeln(FloatToStr(PercentDone) + '% done'); if(Shape1.Width >= BarSize) then Shape1.Width:= BarSize; Shape1.Width:= ((CurrentStep div TotalSteps) * BarSize); Writeln('Shape drawn: ' + IntToStr(Shape1.Width) + '/' + IntToStr(BarSize)); if(Shape1.Width >= BarSize) then Shape1.Width:= BarSize; Label1.Caption:= FloatToStr(PercentDone) + '%'; if(Label1.Caption = '100%')then begin Timer1.Free; Label1.Left:= Label1.Left - 3; end; end;