home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,592 of 2,978   
   Rudolf Wiesendanger to Floris   
   Re: slow writing of text files   
   12 May 05 04:04:58   
   
   From: ruediw@lycos.com   
      
   "Floris"  wrote in   
   news:3ua9l2-rjc.ln1@babylon5.intern.meteocon.nl:   
      
   > Hello all,   
   >   
   > I'm using freepascal to write text files, but it writes really slow.   
   > It looks something like this and it writes with about 300 KB per   
   > second:   
   >   
      
   > for i:=1 to 1000 do   
     begin   
   >   outfilename='myname'+integertostring+'.txt'   
   >   Assign (outfile,outfilename);   
   >   rewrite(outfile);   
       {-- here You write to file --}   
   >   for j:=1 to 16000 do   
       begin   
   >     for k:=1 to 4 do   
         begin   
   >       write (outfile,myarray[i][j][k]:2:2,',');   
   >     end;   
   >     writeln (outfile);   
      
       End;  {-- for j:=1 to 16000 do --}   
       {-- here You should close the file --}   
       close (outfile);   
    end;  {-- for i:=1 to 1000 do --}   
      
   You should allways close a file after You don't need to   
   read/write ...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca