Writing Flat Text Files, Memory Problems 
Author Message
 Writing Flat Text Files, Memory Problems

I have been writing a VB app that creates text files(HTML pages actually).
I write the pages one character at a time and have found that the
application gets VERY slow after the first 15-20k.  Even after closing the
file, it seems as if there is a significant amount of memory tied up
someplace.  Any suggestions?
--
Shawn Brock
Speedway SuperAmerica



Sat, 24 Mar 2001 03:00:00 GMT  
 Writing Flat Text Files, Memory Problems
Write the file one line instead.  Writing one character to a file at a time
would slow things down considerably.  You might also be running into some
"flushing" issues.  Is the OS putting information into the file
automatically or waiting until you close it, in which case it flushes
everything.
Quote:

>I have been writing a VB app that creates text files(HTML pages actually).
>I write the pages one character at a time and have found that the
>application gets VERY slow after the first 15-20k.  Even after closing the
>file, it seems as if there is a significant amount of memory tied up
>someplace.  Any suggestions?
>--
>Shawn Brock
>Speedway SuperAmerica




Sat, 24 Mar 2001 03:00:00 GMT  
 Writing Flat Text Files, Memory Problems
why in the world would you write one byte at a time ???

use something like this

-------------------
dim ff as integer
ff=freefile
open "c:\mypage.html" for output as #ff
print #ff,"<HTML>"
print #ff,"<BODY>"
print #ff,"<H1>This is fast</H1>"
print #ff,"</BODY>"
print #ff,"</HTML>"
close #ff
--------------------

that should do the trick just fine !

rgds,
Kris T.



Sat, 24 Mar 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Writing Flat Text Files, Memory Problems

2. Help: Update PowerPoint slide Text from a flat text file from within VB

3. Writing to a flat file

4. Writing a flat file without double quotes

5. Write to flat file in .asp

6. writing form data to a flat file.

7. read/write locking flat files

8. Reading from a text file and writing toa text file from Vis Bas 6.0

9. Write contents of listbox to text file/populate listbox from text file

10. Problem writing to a plain text file

11. Writing a text file called prn problem.

12. Problems Writing to a Text File

 

 
Powered by phpBB® Forum Software