Insert a line into text file

BlitzMax Forums/BlitzMax Beginners Area/Insert a line into text file

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is really annoying me.
Should be simple. Basically, I'm trying to insert a line to a test file...
myfile:TStream=WriteStream("test.txt")
	If WriteLine(myfile,"Hello") Print "Hello successful!"
	If WriteLine(myfile,"World") Print "World successful!"
CloseStream(myfile)
myfile1:TStream=OpenStream("test.txt")
ReadLine(myfile1)
If WriteLine(myfile1,"AGAIN") Print "AGAIN successful"
CloseStream(myfile1)
myfile2:TStream=ReadStream("test.txt")
	While Not Eof(myfile2)
   		Print ReadLine(myfile2)
	Wend
CloseStream(myfile2)

<edit> P.s. tried simple writefile/openfile/readfile. I just can't get Openstream/file to read and write. Seems to only allow one of them.