Line check

I got a program wich stores some values and every time it saves it ads another line in a txt file but I want that when there are 3 lines in it.



so how do I make that the next time you save it saves on the next line ?

and when there are 3 lines it exports al the lines to a new file, but when i exports again it adds them to the previous 3
[368 byte] By [Greenjedi] at [2007-11-19 21:51:13]
# 1 Re: Line check
...that post is almost confusing...but here goes...

to add more stuff to an existing file you need to open the file for appending

Dim fOpen As New IO.StreamWriter(fName,True)
'the True boolean open the existing file for appending

to save stuff on a new line either add a vbCRLF to the end of the previous line OR use the writeline method

fOpen.WriteLine("Writeline writes this text and adds a VbCRLF to the end")
HTH
kevin
kebo at 2007-11-10 3:13:43 >
# 2 Re: Line check
I mean something like this, but this one will always write the first line, I want it to skip the used lines

Const FILE_NAME As String = "data/time.dat"
Dim sr As StreamWriter = File.CreateText(FILE_NAME)
sr.WriteLine(Date.Now)
sr.Close()
Greenjedi at 2007-11-10 3:14:41 >