How to get linechange to windows notepad?

Find quick help here to get you started with Hollywood
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

How to get linechange to windows notepad?

Post 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?
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: How to get linechange to windows notepad?

Post 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"
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to get linechange to windows notepad?

Post 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.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: How to get linechange to windows notepad?

Post 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?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to get linechange to windows notepad?

Post 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.
Post Reply