Chr(10) and Chr(13)
# Chr(10) returns a linefeed character
# Chr(13) returns a carriage return character
I am writing to a text file and when I use either Chr(10) or Chr(13), I get data written on file on a new line however the difference I see is if (and that breaks my program) is Chr(10) returns 2 lines at the very end. It's very strange. When I use Chr(13) it returns only one line at the end which is perfect.
Also, I read some post and suggests using both but that gives me double lines at the end as well...
Anyone have more info on these two Chr's?
10 is a Line Feed, and 13 is a Carriage Return. Which means usually people do #Chr(13)##Chr(10)#
Comments on this post
From a system point of view Windows tends to use the pair, CR/LF, even if a programmer only provides the LF. 'Nix tends to use LF. Mac (used to be, anyway) uses the CR.
An early I/O device, the teletype, needed one to return the carriage and the other to feed the line (unlike a typewriter, where both are usually associated with one keystroke).