Solved

variables in object names

Posted on 1998-10-24
3
159 Views
Last Modified: 2010-04-06
I wanted to change 30 images at once.

TImage1, Timage2, Timage3......... etc...

A simple for next loop could do it if only I could substitute a variable in
the object name

e.g.     Timage(a)

The closest I've got is defining an array of Timages and then linking them
to the real images

e.g. Tempimage[1]:=Timage1
       Tempimage[2]:=Timage2

Tempimage[a]      works, but I know in my heart it's a cop out. I am a
newbie but I want to learn...

Is it possible... and how...???


Many thanks,
0
Comment
Question by:blobb
  • 2
3 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1344206
Just use:

TImage[i]:=findcomponent('TImage'+inttostr(i));

or directly use something like: findcomponent(yourcomponentname);
0
 

Author Comment

by:blobb
ID: 1344207
Thanks dwwang

but I get an error message from the compiler..

incompatible types: Timage and Tcomponent
0
 
LVL 4

Accepted Solution

by:
dwwang earned 50 total points
ID: 1344208
Hi, this is just a general method, for special perpose, you can use:

TImage[i]:=findcomponent('TImage'+inttostr(i)) as TImage;
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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