Difference Between Carriage Return, Line Feed and End of Line Characters

Updated Dec 14, 2017

Reported In

Software

  • LabVIEW Professional
  • LabVIEW Base
  • LabVIEW Full

Issue Details

Putting a Carriage Return, Line Feed, or End of Line character in my strings in LabVIEW seems to all do the same thing. What is the difference between these three characters?



Solution

All three of these characters are ASCII representations for the end of the line. In LabVIEW strings they all appear to have the functionality of the End of Line character, however at the operating system level, they are each treated differently.

 The Carriage Return (CR) character (0x0D, \r) moves the cursor to the beginning of the line without advancing to the next line. This character is used as a new line character in Commodore and Early Macintosh operating systems (OS-9 and earlier).

 The Line Feed (LF) character (0x0A, \n) moves the cursor down to the next line without returning to the beginning of the line. This character is used as a new line character in UNIX based systems (Linux, Mac OSX, etc).

 The End of Line (EOL) character (0x0D0A, \r\n) is actually two ASCII characters and is a combination of the CR and LF characters. It moves the cursor both down to the next line and to the beginning of that line. This character is used as a new line character in most other non-Unix operating systems including Microsoft Windows, Symbian OS and others.

WAS THIS ARTICLE HELPFUL?

Not Helpful