Solved

use component like a array (timer1, timer2...)

Posted on 1998-08-31
1
199 Views
Last Modified: 2010-04-04
I have more timers (timer1 timer2 timer3...) how can I use them with a counter (int c;).
for Example something like that:
timer[c].enabled := true

Thank you.
0
Comment
Question by:zulliger
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 50 total points
ID: 1338302
zulliger,

(1) The nasty variant:
var timerArr : array [1..77] of TTimer;
procedure TForm1.Create(Sender: TObject);
begin
  timerArr[1]:=timer1; timerArr[2]:=timer2; timerArr[3]:=...
end;

(2) A little bit better:
Create your timers at runtime, not at designtime.
var timerArr : array [1..77] of TTimer;
procedure TForm1.Create(Sender: TObject);
var i1 : integer;
begin
  for i1:=1 to 77 do begin
    timerArr[i1]:=TTimer.Create(Form1);
    with timerArr[i1] do begin
      enabled:=...; ...
    end;
  end;
end;

Regards, Madshi.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question