I can not create text files that are readable by other programs such as Notepad (Windows).
B4X:
Dim TW As TextWriter
TW.Initialize(File.OpenOutput(File.DirRootExternal,NomeFileLog,False))
TW.Writeline ("OziExplorer Track Point File Version 2.1")
TW.Writeline ("WGS 84")
TW.Writeline ("Altitude Is in Feet")
TW.Close
B4X:
'------------------------- CRLF
Dim TW As TextWriter
TW.Initialize(File.OpenOutput(File.DirRootExternal,NomeFileLog,False))
TW.Write ("OziExplorer Track Point File Version 2.1"&CRLF)
TW.Write ("WGS 84"&CRLF)
TW.Write ("Altitude Is in Feet"&CRLF)
TW.Close
B4X:
'------------------------- CR
Dim TW As TextWriter
dim CR as string
CR=chr(13)
TW.Initialize(File.OpenOutput(File.DirRootExternal,NomeFileLog,False))
TW.write ("OziExplorer Track Point File Version 2.1"&CR)
TW.Write ("WGS 84"&CR)
TW.Write ("Altitude Is in Feet"&CR)
TW.Close
I also tried to initialize TextWriter with a Encoding (Windows-1252 e other)
TW.Write ("OziExplorer Track Point File Version 2.1"&chr(13)&chr(10))
TW.Write ("WGS 84"&&chr(13)&chr(10))
TW.Write ("Altitude Is in Feet"&&chr(13)&chr(10))
Nothing.
I look at files with FileAlyzer and always that damn $0A and not $0D0A
The problem is not trivial, since there are several hours behind me, without success.
A moment of calm and I look back, in a fresh mind.
Thanks for the moment.
Dim TW As TextWriter
TW.Initialize(File.OpenOutput(File.DirRootExternal,"test_caratteri3b.txt",False))
TW.Write ("OziExplorer Track Point File Version 2.1"&Chr(0x0d)&Chr(0x0a))
TW.Write ("WGS 84"&Chr(0x0d)&Chr(0x0a))
TW.Write ("Altitude Is in Feet"&Chr(0x0d)&Chr(0x0a))
TW.Close
The final purpose of my app is not to create and display a text file in notepad. It is (fully achieved, thanks!) to create and display a text file in commercial software (CompeGPS Land) and also on a web page (with ASP, VBScript and Javascript scripts).
Thanks again to everyone!