|
-
Mar 10th, 2000, 11:57 AM
#1
Thread Starter
Lively Member
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
-
Mar 10th, 2000, 03:26 PM
#2
Lively Member
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
-
Mar 10th, 2000, 05:12 PM
#3
Thread Starter
Lively Member
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|