Hey, I'd like to write to a text file to record a set of scores. However, everytime I write to it it overwrites what was originally in the file. Please can someone tell me how to not let it overwrite what is there or how to make it start writing in an empty space. Thank you in advance.
views:
99answers:
2
+6
A:
Open the file 'for append'.
This will erase the file:
Open "C:\path\to\file.txt" For Output As FILE
This will not erase the existing content:
Open "C:\path\to\file.txt" For Append As FILE
Konerak
2010-05-11 15:06:12
Thank you very much, this has worked fantastically
Emma
2010-05-11 15:09:45
A:
VB6's file manipulation sucks. If you have to read a file and immediately write the data out (that is not appended) in the same loop for a conversion/some sort of manipulation. Open the original file, manipulate it but write to a "new" file with a different name in the same directory. At the end of the process, you save the new file, delete the original and then rename the new file to the old.
jasonk
2010-05-12 16:02:26