4.3. Timer
obyektini ikki marta bosib, uning
protsedurasiga quyidagi
operatorlarni kiriting:
. procedure TForm1.Timer1Timer(Sender: TObject);
begin
i:=i+1;
if i mod 12 =1 then
begin light_off;
canvas.brush.Color:=clRed;
canvas.Ellipse(20,20,70,70);
end;
if i mod 6 =0 then
begin light_off;
canvas.brush.Color:=clYellow;
canvas.Ellipse(80,20,130,70);end;
if i mod 12 =7 then
begin light_off;
canvas.brush.Color:=clGreen;
canvas.Ellipse(140,20,190,70);
end; end;
4.4. Bu protseduradan oldin light_off protsedurasini kiriting:
procedure light_off;
begin
form1.canvas.brush.Color:=clBlue;
form1.canvas.Rectangle(10,10,200,80);
form1.canvas.brush.Color:=clGray;
form1.canvas.Ellipse(20,20,70,70);
form1.canvas.Ellipse(80,20,130,70);
form1.canvas.Ellipse(140,20,190,70);
end;