Question : manipulating components

Hi
I am managing old Delphi 7 code
I have a form with many TEdit
I use the following code to clear values on my form
My problem is I cannot figure out how to stop certain values from clearing
Example
Edit1.text =’Main Information’
Edit2.text =’General Information’
Edit3.text =’General Information’
Edit4.text =’General Information’

When I use the my following procedure
I need to stop Edit1.text =’Main Information’ from clearing

procedure TForm1.Clear_values
var
j : Integer;
begin
for j := 0 to ComponentCount-1 do
begin
for j := 0 to ComponentCount-1 do
begin

if TEdit(Components[j]).Parent.Name = 'edit2' then showmessage('TEST');

   if (Components[j] is TEdit) then
     (Components[j] as TEdit).Text := '';
   if (Components[j] is Tcheckbox) then
     (Components[j] as Tcheckbox).checked := false;
   if (Components[j] is TRadioButton) then
     (Components[j] as TRadioButton).checked := false;
    if (Components[j] is TComboBox) then
     (Components[j] as TComboBox).Itemindex := -1;
    if (Components[j] is Tmemo) then
     (Components[j] as Tmemo).text := '';
end;

Thank you

Answer : manipulating components

procedure TForm1.Clear_values
var
  j : Integer;
begin
  for j := 0 to ComponentCount-1 do
  begin
    for j := 0 to ComponentCount-1 do
    begin

     if (Components[j] is TEdit) and (Components[i] <> Edit1) then
       (Components[j] as TEdit).Text := '';
     if (Components[j] is Tcheckbox) then
       (Components[j] as Tcheckbox).checked := false;
     if (Components[j] is TRadioButton) then
       (Components[j] as TRadioButton).checked := false;
     if (Components[j] is TComboBox) then
       (Components[j] as TComboBox).Itemindex := -1;
     if (Components[j] is Tmemo) then
       (Components[j] as Tmemo).text := '';
end;
Random Solutions  
 
programming4us programming4us