Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fields to xml

Status
Not open for further replies.

Torquemalex

Programmer
Joined
Aug 25, 2008
Messages
2
Location
FR
Hi

I've an application with many fields (edit, combo, radio, ecc) and I'm looking for a quick and easy way to save/load all the data in the field. No matter if on an ini-like or xml file.
I'd prefer a loop inside all the components, in order not to be forced to change the load/save function when I add new components.

Can anybody please help me?

Thanks in advance and best regards!

Alex
 
Could be something like (untested):
Code:
procedure TForm1.SaveComponentData;
var
  i: integer;
begin
  for i := 0 to Self.ComponentCount -1 do
  begin
    if Self.Components[i] is TEdit then
      SaveTEdit(Self.Components[i]);
  end;
end;

You might use a Case statement instead of a if...then structure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top