这段代码在平台中怎么实现? 下面写法是我在delphi中实现的
var
F : TextFile;
I ,J : INTEGER;
str : String;
begin
AssignFile(F, 'D:\MyFile.txt');
Rewrite(F);
writeln(F,'ÌîÖÆÆ¾Ö¤,V800') ;
for i := 1 to Adoquery1.RecordCount do
begin
str := '';
for J := 1 to AdoQuery1.FieldCount do
begin
if j = 1 then
begin
if AdoQuery1.Fields.Fields[j-1].DataType = ftbcd then
str := str + formatfloat('#0.00',AdoQuery1.Fields.Fields[j-1].AsFloat)
else
str := str + AdoQuery1.Fields.Fields[j-1].AsString;
end
else
if AdoQuery1.Fields.Fields[j-1].DataType = ftbcd then
str := str +','+ formatfloat('#0.00',AdoQuery1.Fields.Fields[j-1].AsFloat)
else
str := str +','+ AdoQuery1.Fields.Fields[j-1].AsString;
end;
//if i < Adoquery1.RecordCount then
writeln(F,str) ;
Adoquery1.Next;
end;
closefile(F); |