Para guardar el contenido de los edits en un archivo de texto podrías valerte de la clase TIniFile, haciendo esto:
Código Delphi
[-]
uses IniFiles;
procedure TForm1.GuardaInfo;
var
I: Integer;
Ini: TIniFile;
begin
Ini := TIniFile.Create('datos.ini');
try
for I := 0 to ComponentCount - 1 do
if (Components[i] is TEdit) then
Ini.WriteString('Datos', Components[i].Name, TEdit(Components[i]).Text);
finally
Ini.Free;
end;
end;
procedure TForm1.RecuperaInfo;
var
I: Integer;
Ini: TIniFile;
begin
Ini := TIniFile.Create('datos.ini');
try
for I := 0 to ComponentCount - 1 do
if (Components[i] is TEdit) then
TEdit(Components[i]).Text := Ini.ReadString('Datos', Components[i].Name, '');
finally
Ini.Free;
end;
end;
Hasta luego.
