I tried to write more lines in .txt file with function WriteLine, but the result is a txt file with only one line.
This is an example of what i want to do:
B4X:
Dim f As TextWriter
f.Initialize(File.OpenOutput("C:\Users\user01\Desktop","a.txt",True))
f.WriteLine("1")
f.WriteLine("2")
f.WriteLine("3")
f.Close
I tried also:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
Dim st() As String = Array As String("1","2","3")
For i = 0 To st.Length-1
Write(st(i))
Next
End Sub
Sub Write(tx As String)
Dim f As TextWriter
f.Initialize(File.OpenOutput("C:\Users\user01\Desktop","a.txt",True))
f.WriteLine(tx)
f.Close
End Sub
But the result is the same, all strings are written in only one line
Dim f As TextWriter
f.Initialize(File.OpenOutput("C:\Users\user01\Desktop","a.txt",True))
f.WriteLine("1" & Chr(13))
f.WriteLine("2" & Chr(13))
f.WriteLine("3" & Chr(13))
f.Close
It also depends on which editor you use to read the file.
Using Notepad++ you will get separate lines, as that will take the LF at the end of the line as if it were CRLF.
Reading the file back in with f.ReadLine will read them as separate lines too.