change some propery without write the name of object

hi
i have a question about my objects in form
i wanna write a command that it clears all text from my object in form but i dont want write like this :
Edit1.text:=''; edit2.text:=''; ........
i wanna know is there any command that i can use it to change some properties from my objects without write the name of object
tanxfull
Mahsa
Mahsa60Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

esoftbgCommented:
var
  I:      Integer;
begin
  for I := 0 to ComponentCount-1 do
    if (Components[I] is TEdit) then
      TEdit(Components[I]).Text := '';
end;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mahsa60Author Commented:
these codes work correctly but i can't use it into another forms
i mean , i wanna write a procedure that i can call it in another forms , the codes which are written on above work just in the form that i write procedure on it
how can i change it to use it in all my forms
tanxfull
Mahsa
esoftbgCommented:
Excuse me, I was out of home for a long time ....

procedure ClearEdits(Owner_is: TWinControl);
 var
  I:      Integer;
begin
  for I := 0 to Owner_is.ComponentCount-1 do
    if (Owner_is.Components[I] is TEdit) then
      TEdit(Owner_is.Components[I]).Text := '';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClearEdits(Self);
//  ClearEdits(Form1);
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  ClearEdits(Self);
//  ClearEdits(Form2);
end;
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.