How to get linechange to windows notepad?

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

How to get linechange to windows notepad?

Post by Bugala » Thu Feb 04, 2016 7:24 pm

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: 691
Joined: Sun Feb 14, 2010 8:11 pm

Re: How to get linechange to windows notepad?

Post by Bugala » Thu Feb 04, 2016 7:28 pm

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: 2558
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: How to get linechange to windows notepad?

Post by airsoftsoftwair » Fri Feb 05, 2016 5:05 pm

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: 691
Joined: Sun Feb 14, 2010 8:11 pm

Re: How to get linechange to windows notepad?

Post by Bugala » Sat Feb 06, 2016 12:34 am

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: 2558
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: How to get linechange to windows notepad?

Post by airsoftsoftwair » Sun Feb 07, 2016 1:15 pm

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