Ver Mensaje Individual
  #2  
Antiguo 05-04-2017
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola victor_ari25, bienvenido a los foros de Club Delphi y junto a la bienvenida te invito a leer nuestra guía de estilo.

Te soy sincero, no sé si interpreté correctamente tu pregunta, pero a ver si te sirve así:
Código Delphi [-]
procedure TuForm.SaveFields(const aFileName: string);
var
  TS: TStrings;
  i : Integer;
  s : string;
begin
  TS := TStringList.Create;
  try
    TuQuery.First;
    while not TuQuery.Eof do
    begin
      s := '';
      for i := 0 to TuQuery.FieldCount-1 do
        s := s + TuQuery.Fields[i].AsString + ',';
      TuQuery.Next;
      if TuQuery.Eof then
        SetLength(s, Length(s) - 1);
      TS.Add(s)
    end;
    TS.SaveToFile( aFileName );
  finally
    TS.Free;
  end;
end;

Ejemplo llamada:
Código Delphi [-]
procedure TuForm.Button1Click(Sender: TObject);
begin
  SaveFields('Fields.txt');
end;

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita