Board index » delphi » variables in object names Help!

variables in object names Help!

I wanted to change 30 images at once.

Image1, image2, image3......... etc...

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

e.g.     Image(a)

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

e.g. Tempimage[1]:=Image1
       Tempimage[2]:=Image2

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,

 

Re:variables in object names Help!


Don't know if I understood your problem, but have you tried to take a
look at TImageList component?
Quote
Blobb wrote:

> I wanted to change 30 images at once.

> Image1, image2, image3......... etc...

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

> e.g.     Image(a)

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

> e.g. Tempimage[1]:=Image1
>        Tempimage[2]:=Image2

> 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,

Re:variables in object names Help!


Quote
Marcus Kubota wrote in message <3638D238.5C8B7...@bigfoot.com>...
>Don't know if I understood your problem, but have you tried to take a
>look at TImageList component?

Yes, find component works well and although I still have to assign an array
to be able to use
variables with objects, it certainly cuts down the repetition.

Thanks for answering!

Other Threads