[Gambas-user] "Write" loses data

Gianluigi bagonergi at gmail.com
Fri Nov 3 15:15:05 CET 2017


Public Sub Main()

  Dim sPath As String = "/tmp/myFile.txt"
  Dim i As Integer
  Dim fl As File

  fl = Open sPath For Create
  For i = 1 To 6
      Write #fl, "The row " & CStr(i) & "\n"
  Next
  fl.Close

  fl = Open sPath For Append
  For i = 7 To 12
      Write #fl, "The row " & CStr(i) & "\n"
  Next
  fl.Close

  fl = Open sPath For Write
  For i = 1 To 6
      Write #fl, "The long row " & CStr(i) & "\n"
  Next
  fl.Close

End


Rows 7, 8 and 9 are lost, but "Write" should not just overwrite the first
six rows?

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20171103/79fb0c76/attachment.html>


More information about the User mailing list