Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between chr(13) and chr(10)

What is the difference between chr(13) and chr(10) in Crystal Reports?

I know chr(13) is used as a line break. But one of our reports uses this line:

{Address1} + chr(13) + chr(10) + {Address2}
like image 988
Ritesh Gupta Avatar asked Aug 04 '16 09:08

Ritesh Gupta


People also ask

What is CHR 13 in SQL?

Char(13) – Carriage Return.

What is CHR 13 in ASCII?

CR (character : \r, Unicode : U+000D, ASCII : 13, hex : 0x0d) : This is simply the 'r' character. This character is commonly known as 'Carriage Return'. As matter of fact, \r has also has a different meaning. In older printers, \r meant moving the print head back to the start of line and \n meant starting a new line.

What is CHR 13 in python?

The chr(13) is a carriage return character while the chr(10) is a line feed character.


1 Answers

Chr(10) is the Line Feed character and Chr(13) is the Carriage Return character.

You probably won't notice a difference if you use only one or the other, but you might find yourself in a situation where the output doesn't show properly with only one or the other. So it's safer to include both.


Historically, Line Feed would move down a line but not return to column 1:

This  
    is  
        a  
            test.

Similarly Carriage Return would return to column 1 but not move down a line:

This  
is  
a  
test.

Paste this into a text editor and then choose to "show all characters", and you'll see both characters present at the end of each line. Better safe than sorry.

like image 155
Robyn625 Avatar answered Sep 30 '22 16:09

Robyn625