Solved

variables in object names

Posted on 1998-10-24
3
158 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
Comment Utility
Just use:

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

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

Author Comment

by:blobb
Comment Utility
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
Comment Utility
Hi, this is just a general method, for special perpose, you can use:

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now