Link to home
Start Free TrialLog in
Avatar of blobb
blobb

asked on

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,
Avatar of dwwang
dwwang

Just use:

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

or directly use something like: findcomponent(yourcomponentname);
Avatar of blobb

ASKER

Thanks dwwang

but I get an error message from the compiler..

incompatible types: Timage and Tcomponent
ASKER CERTIFIED SOLUTION
Avatar of dwwang
dwwang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial