Carriage return is a term used in computing and printing to refer to the action of moving the cursor back to the left margin, such as when typing text on an old typewriter or filling out a form. The carriage return can also be seen in some types of programming languages where it is used to denote the end of a line. This article will discuss what carriage returns are and how they’re used.
Table of Contents
What is Carriage Return?
A carriage return was a lever on the left-hand side of typewriters that moved the paper up. It eventually evolved into an automatic power return, which is now pressed with your pinky finger to move it back and start over again.
The carriage return, also known as the enter key, was once called a lever. This is because it served the same function of moving to another line when pressed after each sentence or so.
Nowadays with word wrap enabled by default in most programs and online text fields like Facebook comment boxes etc., you can just press Shift + Enter at any time to move down onto your next paragraph without having to use an actual physical “return” button on your keyboard (which has since been replaced with something that looks more modern).
The hard-pressing of this key only happens now when ending paragraphs but not for starting them anymore .
Carriage return is a command that causes the printer to be positioned, or the cursor to be displayed, at the left margin. It also controls paper feeding in ASCII and Unicode by making decimal 13 become \r.
Since different operating systems use their own codes, text files are incompatible between them. For example one finishes a line with carriage return (Macintosh), while another ends it with newline(Linux). The ASCII code is also different: CR being 13 and LF being 10 for Linux; CRLF in Microsoft products (CRLF = Carriage Return + Line Feed).
Is carriage return the same as enter?
No. Enter is the same as carriage return, but it can also be used to denote tab stops or new lines in programming languages like Visual Basic, Python etc.
Where does carriage returns come from?
Carriage returns originated on typewriters where typesetters would use them between sentences and paragraphs so they could line up as they were setting the type on a page.
How can carriage return be used in programming?
Carriage returns are often seen as line endings, and thus control flow of text within languages like Visual Basic and Python which use newlines to signify where code should continue and end.