Vas a tener que agregar un componente SaveDialog
Código Delphi
[-]
procedure TForm1.ExportaratxtClick(Sender: TObject);
var
archivo : textfile;
x : string;
cont : integer;
begin
cont := 0;
if not query1.IsEmpty then
begin
try
savedialog1.DefaultExt := 'cvs';
savedialog1.Filter := 'Text files (*.cvs)|*.cvs';
if savedialog1.Execute then
if savedialog1.FileName <> emptystr then
begin
assignfile(archivo,savedialog1.filename);
rewrite(archivo);
writeln(archivo,'NOMBRE','APELLIDO','EDAD');
query1.First;
while not (query1.Eof) do
begin
x := query1.fieldbyname('NOM').AsString + ';'
+ query1.fieldbyname('APE').AsString + ';'
+ query1.fieldbyname('EDAD').AsString;
writeln(archivo,x);
query1.Next;
cont := cont + 1;
end;
flush(archivo);
closefile(archivo);
showmessage('Total de archivos exportados: '+inttostr(cont));
end;
except
on e : exception do
showmessage(e.Message);
end;
end;
end;
Cualquier cosa me preguntas.
Yanina Genia