Topic: How to add two or more timers in script?

Hi,

Is it possible to add two or more timers to integrating in a script? One example please.
Thanks and happy new year!

Re: How to add two or more timers in script?

Hello,


Yes.

var
   Timer1: TTimer;
   Timer2: TTimer;

procedure Form1_OnShow (Sender: string; Action: string);
begin
     Timer1 := TTimer.Create (nil);
     Timer1.OnTimer := @OnTimer1;
     Timer1.Interval := 1000;
     Timer1.Enabled := True;

     Timer2 := TTimer.Create (nil);
     Timer2.OnTimer := @OnTimer2;
     Timer2.Interval := 1000;
     Timer2.Enabled := True;

end;

procedure OnTimer1;
begin
     
end;

procedure OnTimer2;
begin
     
end;

procedure Form1_OnClose (Sender: string; Action: string);
begin
     Timer1.Free;
     Timer2.Free;
end;
Dmitry.

Re: How to add two or more timers in script?

Thanks, good job