Page 1 of 1

How to get linechange to windows notepad?

Posted: Thu Feb 04, 2016 6:24 pm
by Bugala
As I am using WriteString() to write to debuglog.txt file, I am adding "\n" at end of each line, however, when i open it with windows notepad, there are no line changes.

Am i doing something wrong, or is it as i suppose, a windows notepad problem, that the notepad uses something else for line change, and if it does, then what is it and can i put it through hollywood?

Re: How to get linechange to windows notepad?

Posted: Thu Feb 04, 2016 6:28 pm
by Bugala
Right after having posted it came to my mind that all mighty google must know the answer, and yes, Windows notepad linechange (or EOL = End Of Line) is: "\r\n"

Re: How to get linechange to windows notepad?

Posted: Fri Feb 05, 2016 4:05 pm
by airsoftsoftwair
It's not just Windows Notepad that uses CRLF for a line break but the entire operating system uses it. On Windows, all line breaks are actually two characters: Carriage return and line feed. If you use WriteLine(), Hollywood will take care of this automatically. If you write raw data using WriteString(), you have to do this manually of course.

Re: How to get linechange to windows notepad?

Posted: Fri Feb 05, 2016 11:34 pm
by Bugala
Ah, didnt notice that WriteLine() command.

So am I right that since I am writing one line at a time, it is better for me to use WriteLine() command than using WriteString and manually adding line change?

Re: How to get linechange to windows notepad?

Posted: Sun Feb 07, 2016 12:15 pm
by airsoftsoftwair
There is no real difference between the two except that WriteLine() and ReadLine() will take care of the platform differences in CRLF and LF automatically so you don't have to worry about this.