Hi,
You are creating a new file each time you call savetexttofile and
writing one line to it. Try something like this.
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
Dim objReader As StreamWriter
Try
objReader = New StreamWriter(FullPath)
For inti = 1 To 16
objReader.Write("Channel" & " " & inti & " = " & dchanPos(inti),
"C:\Documents and Settings\Maarten\My Documents\PLC.uni")
Next
objReader.Close()
Catch Ex As Exception
ErrInfo = Ex.Message
End Try
End Sub
Ken
-----------------
"Maarten" <gu******@hotmail.com> wrote in message
news:41***********************@news.skynet.be...
Public Function SaveTextToFile(ByVal strData As String, _
ByVal FullPath As String, _
Optional ByVal ErrInfo As String = "") As Boolean
Dim Contents As String
Dim bAns As Boolean = False
Dim objReader As StreamWriter
Try
objReader = New StreamWriter(FullPath)
objReader.Write(strData)
objReader.Close()
bAns = True
Catch Ex As Exception
ErrInfo = Ex.Message
End Try
Return bAns
End Function
thanks Maarten
"Maarten" <gu******@hotmail.com> wrote in message
news:41**********************@news.skynet.be...
hi all when i do this:
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
For inti = 1 To 16
Call SaveTextToFile("Channel" & " " & inti & " = " & dchanPos(inti),
"C:\Documents and Settings\Maarten\My Documents\PLC.uni", "Error")
Next
End Sub
it only saves the last loop so in the textfile stands Channel 16 = False
but i want al lines (16) are saved in the file
thanks Maarten