I'm a newbie with Lazarus and now I'm trying to understand main principles how it works. I made a small program which draws filled rectangles inside of paintbox control. This code works fine.
var
Rec: TRect;
x: integer;
begin
for x := 0 to 100000 do
begin
rec.Left:=Random(300);
rec.Top:=Random(200);
rec.Right:=Random(300);
rec.Bottom:=Random(200);
Paintbox1.Canvas.Brush.Color:= RGBToColor(Random(255),Random(255),Random(255));
PaintBox1.Canvas.FillRect(rec);
Form1.label1.Caption:= IntToStr(x);
end;
by idea, program should show number of iterations inside of a label control (the last line before end). From some reason, caption property of this control stays unchanged for all time of program's execution. Can someone explain what's wrong here?