I am saving data to a text file, but does not get new lines (as expected) when opening the files with Notepad. It seems like the CRLF is ignored.
I've tried TextWriter with the following code
... and with WriteList with the following code
The files created with each of the above is attached
Am I missing something?
What do I need to do to get the lines to show as separate lines?
I've tried TextWriter with the following code
B4X:
Dim FileName As String
Dim FileDir As String
Dim Txt As String
Dim TW1 As TextWriter
FileName = "TestTextWriter.txt"
FileDir = File.DirRootExternal
TW1.Initialize(File.OpenOutput(FileDir,FileName,False))
For i = 1 To 10
Txt = "This is line "&i&CRLF
TW1.WriteLine(Txt)
Next
TW1.Close
... and with WriteList with the following code
B4X:
Dim FileName As String
Dim FileDir As String
Dim Txt As String
Dim Data As List
FileName = "TestWriteList.txt"
FileDir = File.DirRootExternal
For i = 1 To 10
Txt = "This is line " & i & CRLF
Data.Add(Txt)
Next
File.WriteList(FileDir,FileName,Data)
The files created with each of the above is attached
Am I missing something?
What do I need to do to get the lines to show as separate lines?