How add a line of text to a textfile?

  • Thread starter Thread starter Tor Inge Rislaa
  • Start date Start date
T

Tor Inge Rislaa

How add a line of text to a textfile?

I need a way to open an existing file of type .txt insert a line of tekst
and then close the file again.

TIRislaa
 
Tor Inge Rislaa said:
How add a line of text to a textfile?

I need a way to open an existing file of type .txt insert a line of
tekst and then close the file again.

Pass System.IO.FileMode.Append when opening the filestream.

Pass Microsoft.VisualBasic.OpenMode.Append when using the fileopen sub.
 
Hi,

Try:-

FileOpen(1, "myfile.txt",OpenMode.Append)
Write(1, "My Line of Text")
FileClose(1)

Merlin
 
Back
Top