We help IT Professionals succeed at work.
Get Started

How to write one procedure that can be used by all dbedits?

PeterdeB asked
Last Modified: 2010-04-21
Hi Folks,

I have 10 dbedits. In the onclick event I want to select all text. Now instead of writing ten procedures I want one procedure which can be used by all dbedits. So the dbedit will have to know that it is clicked after which it selects all text.
The dbedits all start with db followed by a name. dbThis, dbThat and so on.

Something (but not quite) like the attached code.

This doesnt work obviously but perhaps someone out here can get it to work or show me the right approach.

Regards Dweep
var db: TDBEdit;
db := Findcomponent('db' + Copy((Sender as TdbEdit).Name, 4, 255)) as

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE