我想把计算出来的数据写入txt文件里(本来想写入excel的,看书好像只能写入txt文件,晕!)
  我做了单不好对齐 !
 procedure TForm1.BitBtn1Click(Sender: TObject);
 const
    VRo2 = 0.882;
  var
  inputfile: TextFile;   Tstr,cco2str,Iro2str:string;  i:integer;
begin
    assignfile(inputfile,'c:\1.txt');
   rewrite(inputfile);
   T:=100;
 for i:=1 to 17 do
   begin        cco2:=1.60067+1.05537e-3*T-6.9641e-7*T*T
           +3.19985e-10*T*T*T-8.60616e-14*T*T*T*T
           +9.80014e-18*T*T*T*T*T;
         cco2:=cco2*100;
        IRo2:=VRO2*CCO2*100;        tstr:=floatTostr(T);
        cco2str:=floatTostr(cco2);
        iro2str:=floatTostr(iro2);        writeln(inputfile,tstr+'   '+ cco2str+'      '+ iro2str);
        T:=T+100;
   end;
   closefile(inputfile);
end;
结果如下:
100   169.95543768414      14990.0696037411
200   178.63129174848      15755.2799322159
300   186.25704103802      16427.8710195534
400   192.97686164736      17020.5591972972
500   198.9178029375      17544.5502190875
600   204.19096355264      18009.6429853428
700   208.89266743698      18424.3332679416
800   213.10563985152      18795.9174349041
900   216.90018339086      19130.5961750739
1000   220.335354      19433.5782228
1100   223.46013699114      19709.1840826185
1200   226.31462306048      19960.9497539343
1300   228.93118430502      20191.7304557028
1400   231.33565023936      20403.8043511116
1500   233.5484838125      20598.9762722625
1600   235.58595742464      20778.6814448532
1700   237.46132894398      20944.089212859
没有对齐,不知怎么控制?