-
Hi,
In this function I can write a string in a *.TXT file.
But the text appears always on top of the file. So when I write for the 2nd time, I automaticly overwrite the previous written string with the new string.
How can I write the next string to the next empty line of my *.TXT file?
Thanks
THE CODE:
Call WriteFile("c:\MyWriteFile\Test.txt", Now())
Function WriteFile(FileName as string, Contents as string)
Dim i as Integer
i = FreeFile
Open FileName for Output as #i
print #i, Contents
Close #i
End Function
-
you need to open the file in append mode:
Open FileName for append as i
opening in append mode will add to your file while output mode will basically recreate your file each time by writing over all your data
-
Thanks