Bruce Axtens Active Member Licensed User Longtime User Apr 25, 2018 #1 What is the terminator of a line when ReadList is used? CRLF, LF or CR? The C# equivalent assumes all three which is annoying because the log files I generate use CR to separate the lines of multiline log entries. What does ReadList assume? Bruce/bugmagnet
What is the terminator of a line when ReadList is used? CRLF, LF or CR? The C# equivalent assumes all three which is annoying because the log files I generate use CR to separate the lines of multiline log entries. What does ReadList assume? Bruce/bugmagnet
DonManfred Expert Licensed User Longtime User Apr 25, 2018 #2 It uses CRLF CRLF As String New line character. The value of Chr(10). Click to expand... Upvote 0
K keirS Well-Known Member Licensed User Longtime User Apr 25, 2018 #3 CR or LF or CR+LF are all treated as line terminators. Upvote 0
K keirS Well-Known Member Licensed User Longtime User Apr 25, 2018 #4 DonManfred said: It uses CRLF Click to expand... Trying: B4X: Dim SB As StringBuilder SB.Initialize SB.Append("Line 1").Append(Chr(13)) SB.Append("Line 2").Append(Chr(10)) SB.Append("Line 3").Append(CRLF) File.WriteString("C:\temp","test.txt",SB.ToString) Log(File.ReadList("C:\temp","test.txt")) Gives: B4X: (ArrayList) [Line 1, Line 2, Line 3] Upvote 0
DonManfred said: It uses CRLF Click to expand... Trying: B4X: Dim SB As StringBuilder SB.Initialize SB.Append("Line 1").Append(Chr(13)) SB.Append("Line 2").Append(Chr(10)) SB.Append("Line 3").Append(CRLF) File.WriteString("C:\temp","test.txt",SB.ToString) Log(File.ReadList("C:\temp","test.txt")) Gives: B4X: (ArrayList) [Line 1, Line 2, Line 3]
Bruce Axtens Active Member Licensed User Longtime User Apr 26, 2018 #5 Pity. Would like to have had the behaviour adjustable. Anyway, thanks. Upvote 0