WriteLine problem

ranba790

Member
Licensed User
Longtime User
Hi
i am running this code on an emulator

Dim Writer As TextWriter
Writer.Initialize(File.OpenOutput(File.DirDefaultExternal, "1.txt", False))
Writer.WriteLine("This is the first line.")
Writer.WriteLine("This is the second line.")
Writer.Close

when i upload the file to the pc and open it in notepad all text shows in one line

any idea why

thanks
 
any idea why
Yes. Android (linux) end of line character is chr(10). Windows end of line characters are chr(13) & chr(10).

You can change your code to:
Code: Copy
Writer.Write("..." & chr(13) & chr(10))
Or you can download a more powerful text editor like notepad++ (highly recommended): Notepad++ | 5.9
This editor knows how to deal with different formats and it also shows you the actual characters.
 
Upvote 0
Yes. Android (linux) end of line character is chr(10). Windows end of line characters are chr(13) & chr(10).

You can change your code to:
Code: Copy
Writer.Write("..." & chr(13) & chr(10))
Or you can download a more powerful text editor like notepad++ (highly recommended): Notepad++ | 5.9
This editor knows how to deal with different formats and it also shows you the actual characters.
Surely that should be:
Code: Copy
Writer.Write("..." & chr(13) )
as chr(10) will be appended anyway?
 
Upvote 0

Similar Threads

Back
Top