Solved

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

Posted on 1998-08-31
1
194 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now