variables in object names

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,
blobbAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dwwangConnect With a Mentor Commented:
Hi, this is just a general method, for special perpose, you can use:

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

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

or directly use something like: findcomponent(yourcomponentname);
0
 
blobbAuthor Commented:
Thanks dwwang

but I get an error message from the compiler..

incompatible types: Timage and Tcomponent
0
All Courses

From novice to tech pro — start learning today.