purplebox wrote
LineBreaks were only specified by chr(13)
maybe you should have an option to choose between "chr(13)" and "chr(13) & chr(10)"
You are right about change the Chr(13). Previously that was what was at the end of each line.
Although it has worked for me so far that was because it is enough when
a file is generated and opened in VS or IE or FF. Even when I
examined the source while in IE it displayed correctly via
Notepad. But to directly open it in Notepad: it was not
right! So my browsers were displaying what I expected, but
Notepad doesn't.
I took a Hex Editor and opened a Notepad file "Test.txt" which had inside:
A
B
C
the Hex contents are: 41 0D 0A 42 0D 0A 43
where 0D is carriage return = chr(13)
and 0A is line feed = chr(10)
So I will opt for the vbCrLf constant which will give me the same
Chr(13) & Chr(10) and work regardless of platform. Now if it
displays and works Okay in Notepad, it will still function just fine in
all the rest. So I have changed it and have opted to skip the
Chr(13) altogether.
The new module stringbuilder.zip available here has been modified for the above if you want to try it again.
Next I will test on some XML files. I am hoping this might
actually solve all problems. Let me know if you happen to test
again and it fails - I would like to examine some of that XML file to
see why if possible.