procedure APP_TEXT(FILENAME:STRING;QRY:TQUERY;SPAN:STRING);
var f:textfile;
j,i:integer;
begin
if QRY.Active=true then
begin
assignfile(f,FILENAME);
rewrite(f,FILENAME);
QRY.First;
for i:=0 to QRY.RecordCount-1 do
begin
for j:=0 to QRY.FieldCount-1 do
begin
write(f,QRY.Fields[j].asstring :QRY.Fields[j].DisplayWidth);
write(f,SPAN);
end;
writeln(f,' ');
QRY.next;
end;
closefile(f);
DM_JGZ.HideWaiting;
Application.MessageBox(PCHAR('文本文件'+FILENAME+'生成成功!'),'信息',MB_OK+MB_ICONINFORMATION);
end
else
Application.MessageBox('请单击查询按钮!','信息',MB_OK+MB_ICONINFORMATION);
end;
end.