?
Solved

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

Posted on 1998-08-31
1
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 100 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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