Ver Mensaje Individual
  #3  
Antiguo 18-05-2007
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
En principio, el código que te envío debiera ejecutarse mas rápido... probalo e informanos de la diferencia en el desempeño.

Código Delphi [-]
procedure TfrmGenerador.salvar_txt(Datos: Tdataset);
var
  I: Integer;
  Registro: string;
  Strs: TStringList;
begin
  Strs := TStringList.Create;
  Datos.DisableControls;
  try
    Datos.First;
    while not Datos.Eof do
    begin
      Registro := '';
      for I := 0 to Datos.FieldCount - 1 do
        Registro := Registro + ',' + Datos.Fields[i].AsString;
      Delete(Registro, 1, 1);
      Strs.Add(Registro);
      Datos.Next;
    end;
    Strs.SaveToFile(ExtractFileDir(Application.ExeName) + '\tmp\Datos.txt');
  finally
    Strs.Free;
    Datos.EnableControls;
  end;
end;

Saludos.
__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita