All Topics  
Carriage return

 

   Email Print
   Bookmark   Link






 

Carriage return



 
 
Originally, carriage return was the term for the control character in Baudot code
Baudot code

The Baudot code, invented by ?mile Baudot, is a character encoding predating EBCDIC and ASCII, and the root predecessor to International Telegraph Alphabet No 2 , the teleprinter code in use until the advent of ASCII....
 on a teletypewriter
Teleprinter

A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
 for end of line return
Return

Return may refer to:* Architectural glossary#R, the receding edge of a flat face* Return , the financial term for the profit or loss derived from an investment...
 to beginning of line and did not include line feed. Later it was used for a mechanism or lever on a typewriter
Typewriter

A typewriter is a Machine or electromechanical device with a set of "keys" that, when pressed, cause Typeface to be printed on a medium, usually paper....
 that would cause the cylinder on which the paper was held (the carriage) to return to the left side of the paper after a line of text had been typed, and would usually move the paper to the next line as well.






Discussion
Ask a question about 'Carriage return'
Start a new discussion about 'Carriage return'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Originally, carriage return was the term for the control character in Baudot code
Baudot code

The Baudot code, invented by ?mile Baudot, is a character encoding predating EBCDIC and ASCII, and the root predecessor to International Telegraph Alphabet No 2 , the teleprinter code in use until the advent of ASCII....
 on a teletypewriter
Teleprinter

A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
 for end of line return
Return

Return may refer to:* Architectural glossary#R, the receding edge of a flat face* Return , the financial term for the profit or loss derived from an investment...
 to beginning of line and did not include line feed. Later it was used for a mechanism or lever on a typewriter
Typewriter

A typewriter is a Machine or electromechanical device with a set of "keys" that, when pressed, cause Typeface to be printed on a medium, usually paper....
 that would cause the cylinder on which the paper was held (the carriage) to return to the left side of the paper after a line of text had been typed, and would usually move the paper to the next line as well. The first power carriage return was added to electric typewriters by Smith Corona
Smith Corona

Smith Corona or the SCM Corporation is a United States typewriter and calculator company . Once a large U.S. manufacturer, the company experienced sales declines in typewriters in the mid-1980s due to the introduction of Personal computer-based word processing....
 in 1960. The key for this was usually labelled "carriage return" or "return". To improve the keyboard for non-English-speakers, the symbol was introduced to mark this key, since this graphic could communicate the action of the key without using words.

Computer analogues


In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, the carriage return (CR) is one of the control characters in ASCII code, Unicode
Unicode

Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems....
 or EBCDIC
EBCDIC

Extended Binary Coded Decimal Interchange Code is an 8-bit character encoding used on IBM mainframe operating systems such as z/OS, OS/390, VM and VSE , as well as IBM midrange computer operating systems such as OS/400 and i5/OS ....
 that commands a printer
Computer printer

File:Lexmark X5100 Series.jpgIn computing, a printer is a peripheral which produces a hard copy of documents stored in computer file form, usually on physical print media such as paper or Transparency ....
 or other sort of display to move the position of the cursor
Cursor (computers)

In computing, a cursor is an indicator used to show the position on a computer monitor or other display device that will respond to input from a text input or pointing device....
 to the first position on the same line. It was mostly used along with line feed, a move to the next line, while carriage return precedes line feed to indicate a new line
Newline

In computing, a newline is a special character or sequence of characters signifying the end of a line of text. The name comes from the fact that the next character after the newline will appear on a new line?that is, on the next line below the text, immediately proceeding the newline....
. The term derives from the above usage, as early printers often closely resembled typewriters; this control character would activate a physical carriage-return mechanism.

On printers
Computer printer

File:Lexmark X5100 Series.jpgIn computing, a printer is a peripheral which produces a hard copy of documents stored in computer file form, usually on physical print media such as paper or Transparency ....
, teletypes, and computer terminal
Computer terminal

A computer terminal is an electronic or electromechanical computer hardware device that is used for entering data into, and displaying data from, a computer or a computing system....
s that were not capable of displaying graphics, the carriage return was used without moving to the next line to allow characters to be placed on top of existing characters to produce character graphics, underlines, and crossed out text.

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

In computing, a newline is a special character or sequence of characters signifying the end of a line of text. The name comes from the fact that the next character after the newline will appear on a new line?that is, on the next line below the text, immediately proceeding the newline....
); others use it only for a paragraph break (a hard return
Hard return

A hard return is a paragraph break in a word processor. It differs from a soft return in that it starts a new paragraph. Besides affecting the document statistics, this means that:...
). Some standards which introduce their own representations for line and paragraph control (for example HTML
HTML

HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '...
) treat carriage return and line feed as whitespace
Whitespace (computer science)

In computer science, whitespace is any single character or series of characters that represents horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visual mark, but typically does occupy an area on a page....
.

In ASCII
ASCII

American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words....
 and Unicode
Unicode

Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems....
, the character code decimal
Decimal

The decimal numeral system has 10 as its Base . It is the most widely used numeral system....
 13 (or hexadecimal
Hexadecimal

In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen....
 0D) is defined to be carriage return. In the C programming language
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and many other languages influenced by it, \r denotes this character.

User interface functionality


On Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
, Macintosh and most other GUI
Gui

Gui or guee is a generic term to refer to grillinged dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients....
 operating systems, hitting the return key also results in the default option of a dialog box
Dialog box

In graphical user interfaces, a dialog box is a special Window , used in user interfaces to display information to the user, or to get a response if needed....
 (usually OK or Yes) being selected.

Mac OS X
Mac OS X

Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
 provides differentiation between the 'return' key and 'enter' key, while Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 does not. Though used interchangeably today, the Return key and Enter key
Enter key

In computer Keyboard s, the enter key in most cases causes a command-line interface, window form or dialog box to operate its default function, which is typically to finish an "entry" and begin the desired process....
 on PC keyboards actually send different scan code
Scancode

A scancode is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard....
s, and so can be programmed for different uses.

Summary

  • Keys commonly generating the character "carriage return":
    "Enter" key
    "Return" key
    key
    Control-M
  • ASCII and Unicode representation of "carriage return":
    Decimal code: 13
    Hexadecimal
    Hexadecimal

    In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen....
     code: 0D
    Symbol: CR
  • Programming escape codes and functions for generating a "carriage return":
    PHP
    PHP

    PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in Standalone software Graphical user interface....
    , Python
    Python (programming language)

    Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive....
    , Bash
    Bash

    Bash is a free software Unix shell written for the GNU Project. Its name is an acronym which stands for Bourne-again shell. The name is a pun on the name of the Bourne shell , an early and important Unix shell written by Stephen Bourne and distributed with Version 7 Unix circa 1978, and the concept of being "Born again Christianity"....
    , C
    C (programming language)

    C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
    /C++
    C++

    C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
    , C#, Java
    Java (programming language)

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
    , Javascript
    JavaScript

    JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
    , Perl
    Perl

    In computer programming, Perl is a high-level programming language, List of programming languages by category, Interpreter , dynamic programming language....
    , Ruby
    Ruby (programming language)

    Ruby is a dynamic programming language, reflection , general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features....
    : \r
    Visual Basic
    Visual Basic

    'Visual Basic' is the third-generation programming language event-driven programming and integrated integrated development environment from Microsoft for its Component Object Model programming model....
     (VB), VBA
    Visual Basic for Applications

    Visual Basic for Applications is an implementation of Microsoft Event-driven programming programming language Visual Basic, and associated integrated development environment , which is built into most Microsoft Office applications....
     and VB.NET
    Visual Basic .NET

    Visual Basic , formerly called Visual Basic .NET , is an object-oriented programming computer language that can be viewed as an evolution of Microsoft Visual Basic implemented on the .NET Framework....
    : vbCr or Chr$(13)
    CFML: Chr(13)
    XML (HTML, XSLT): 
  • Microsoft Office "carriage return":
    Word: Shift-Enter
  • "Find & Replace" regular expression: ^p
    Excel: Alt-Enter
  • OpenOffice.org "carriage return":
    Writer in "Find & Replace" regular expression: $


See also

  • Enter key
    Enter key

    In computer Keyboard s, the enter key in most cases causes a command-line interface, window form or dialog box to operate its default function, which is typically to finish an "entry" and begin the desired process....
  • Newline
    Newline

    In computing, a newline is a special character or sequence of characters signifying the end of a line of text. The name comes from the fact that the next character after the newline will appear on a new line?that is, on the next line below the text, immediately proceeding the newline....
  • Soft return
    Soft return

    In word processing and text-oriented markup languages the term soft return can mean a line break due to word wrapping. Alternatively it can mean a stored line break that is not a paragraph break....
  • Hard return
    Hard return

    A hard return is a paragraph break in a word processor. It differs from a soft return in that it starts a new paragraph. Besides affecting the document statistics, this means that:...