Carriage Return
   HOME

TheInfoList



OR:

A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a
control character In computing and telecommunication, a control Character (computing), character or non-printing character (NPC) is a code point (a number) in a character encoding, character set, that does not represent a written symbol. They are used as in-band ...
or mechanism used to reset a device's position to the beginning of a
line of text {{Unreferenced, date=May 2008 In computing, a line is a unit of organization for text files. A line consists of a sequence of zero or more Character (computing), characters, usually displayed within a single horizontal sequence. Depending on the ...
. It is closely associated with the line feed and
newline Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
concepts, although it can be considered separately in its own right.


Typewriters

Originally, the term "carriage return" referred to a mechanism or lever on a
typewriter A typewriter is a mechanical or electromechanical machine for typing characters. Typically, a typewriter has an array of keys, and each one causes a different single character to be produced on paper by striking an inked ribbon selectivel ...
. For machines where the type element was fixed and the paper held in a moving ''carriage'', this lever was on the left attached to the moving carriage, and operated after typing a line of text to cause the carriage to return to the far right so the type element would be aligned to the left side of the paper. The lever would also usually ''feed'' the paper to advance to the next line. Many electric typewriters such as IBM Electric or
Underwood Underwood may refer to: People *Underwood (surname), people with the surname Places United States * Underwood, Shelby County, Alabama * Underwood, Indiana * Underwood, Iowa * Underwood, Minnesota * Underwood, New York * Underwood, North Dakota * ...
Electric made carriage return to be another key on the keyboard instead of a lever. The key was usually labeled "carriage return", "return", or "power return". With typewriters like the
Selectric The IBM Selectric typewriter was a highly successful line of electric typewriters introduced by IBM on 31 July 1961. Instead of the "basket" of individual typebars that swung up to strike the ribbon and page in a typical typewriter of the perio ...
, where the type element moved when typing and the paper was held stationary, the key returned the type element to the far left and the term "carrier return" was sometimes used for this function. To improve the keyboard for non-English-speakers, the symbol ↵ ( U+21B5,
HTML entity In SGML, HTML and XML documents, the logical constructs known as ''character data'' and ''attribute values'' consist of sequences of characters, in which each character can manifest directly (representing itself), or can be represented by a series ...
↵) was introduced to communicate the combined carriage return and line feed action.


Computers

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, e ...
, the carriage return is one of the control characters in ASCII code,
Unicode Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
,
EBCDIC Extended Binary Coded Decimal Interchange Code (EBCDIC; ) is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding six- ...
, and many other codes. It commands a
printer Printer may refer to: Technology * Printer (publishing), a person or a company * Printer (computing), a hardware device * Optical printer for motion picture films People * Nariman Printer (fl. c. 1940), Indian journalist and activist * James ...
, or other output system such as the display of a
system console One meaning of system console, computer console, root console, computer operator, operator's console, or simply console is the text entry and display device for system administration messages, particularly those from the BIOS or boot loader, the ...
, to move the position of the
cursor Cursor may refer to: * Cursor (user interface), an indicator used to show the current position for user interaction on a computer monitor or other display device * Cursor (databases), a control structure that enables traversal over the records in ...
to the first position on the same line. It was mostly used along with
line feed Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
(LF), a move to the next line, so that together they start a new line. Together, this sequence can be referred to as CRLF. The carriage return and line feed functions were split for practical reasons: * Carriage return by itself provided the ability to overprint the line with new text. This could be used to produce bold or accented characters, underscores, struck-out text, and some composite symbols. * Early mechanical printers were too slow to return the carriage in the time it took to process one character. Therefore, the time spent sending the line feed was not wasted (often several more characters had to be sent to ensure the carriage return had happened before sending a printing character). This is why the carriage return was always sent first. * It was then also possible to fit multiple line feed operations into the time taken for a single carriage return—for example for printing doublespaced text, headers/footers or title pages—to save print and transmission time without the need for additional circuitry or mechanical complexity to "filter out" spurious additional CR signals. As early as 1901,
Baudot code The Baudot code is an early character encoding for telegraphy invented by Émile Baudot in the 1870s. It was the predecessor to the International Telegraph Alphabet No. 2 (ITA2), the most common teleprinter code in use until the advent of ASCII ...
contained separate carriage return and line feed characters. Many computer programs use the carriage return character, alone or with a line feed, to signal the end of a line of text, but other characters are also used for this function (see
newline Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
); others use it only for a
paragraph break A paragraph () is a self-contained unit of discourse in writing dealing with a particular point or idea. Though not required by the orthographic conventions of any language with a writing system, paragraphs are a conventional means of organizing e ...
(a "hard return"). Some standards which introduce their own representations for line and paragraph control (for example
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
) and many programming languages treat carriage return and line feed as whitespace. In
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
and
Unicode Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
, the carriage return is defined as 13 (or
hexadecimal In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, hexa ...
0D); it may also be seen as control+M or . In the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as ...
, and many other languages (including
regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
) influenced by it, \r denotes this character.Eric S. Roberts. ''The Art and Science of C''. Addison-Wesley, 1995. p. 311.


See also

*
Newline Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
*
Enter key On computer keyboards, the enter key and return key are two closely related keys with overlapping and distinct functions dependent on operating system and application. Functions The return key has its origins in two typewriter functions: ca ...
*
Soft return Line breaking, also known as word wrapping, is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area. In text display, line wrap is continuing on a new line when a line is ful ...
*
Hard return Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
*
Unix2dos (sometimes named or ) is a tool to convert line breaks in a text file from Unix format (Line feed) to DOS format ( carriage return + Line feed) and vice versa. When invoked as the program will convert a Unix text file to DOS format, when inv ...
*
C0 and C1 control codes The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, ...


References

{{DEFAULTSORT:Carriage Return Control characters Whitespace