empty text file

anallie0

Active Member
Licensed User
Longtime User
hi
I have to save a set of values ​​and use the following code:

B4X:
Sub scrivireport

If File.ExternalWritable Then

    Dim TextWriter1 As TextWriter
       TextWriter1.Initialize(File.OpenOutput(File.DirDefaultExternal & "/TriageDir", "Report.txt", True))    
         TextWriter1.WriteLine(Colore)
         TextWriter1.WriteLine(Numpaz)
         TextWriter1.WriteLine(Valcrono)
         TextWriter1.WriteLine(Lati)
         TextWriter1.WriteLine(Longi)
         TextWriter1.WriteLine("---")
         
   TextWriter1.close
End If
      

End Sub

when I go to read the file created, it is empty.

What's wrong?
 

anallie0

Active Member
Licensed User
Longtime User
Resolved. mea culpa :sign0013:
Using the file from another part of the code resetting values​​.

A question:

if I open a file with the Append = False, the contents of the file is deleted?
 
Upvote 0
Top