Problems with DOS.library, adding to the end of a file

Discuss any general programming issues here
Post Reply
phipslk
Posts: 24
Joined: Sun Oct 29, 2023 7:21 pm

Problems with DOS.library, adding to the end of a file

Post by phipslk »

Hi,

I wanted to write code that appends lines to an existing textfile, but instead my code keeps overwriting the existing file. Can someone point me to my error please?

Code: Select all

				OpenFile(1,f$,#MODE_WRITE)
				Seek(1,#EOF,0)
				WriteLine(1,a.name)
				WriteLine(1,a.mail)
				WriteLine(1,a.prefix)
				WriteLine(1,a.serial)
				CloseFile(1)
phipslk
Posts: 24
Joined: Sun Oct 29, 2023 7:21 pm

Re: Problems with DOS.library, adding to the end of a file

Post by phipslk »

seems I got the problem: changing to #MODE_READWRITE solved the problem
Post Reply