Re: DOS Newline Character

From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 11/23/04


Date: Tue, 23 Nov 2004 14:02:31 -0500


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roger Leigh wrote:
[snip]
> Summary: CR/LF or CR or LF (or whatever your system uses) are merely
> line-end markers. They don't directly correspond to any mechanical
> operations, which are entirely hardware-dependent.

Funny, the ECMA and ISO standards and my old ASR33 teletypewriter would
disagree with you on this.

To my TTY, a 0x0d (ASCII Carriage Return) retuned the print head to the
left margin, and a 0x0a (ASCII Line Feed) revolved the platen to advance
the paper by exactly one line.

To ECMA, Carriage return "causes the active presentation position to be
moved to the line home position of the same line in the presentation
component", and Line Feed "LF causes the active presentation position to
be moved to the corresponding character position of the following line
in the presentation component." The ISO definition is the same.

Your ESC/P printer seems to act otherwise, although I believe (because
of my own use of an ESC/P printer) that you are incorrect in your
assertions about the ESC/P interpretation of the characters. Certainly,
on my Epson LQ-570 printer, with the "CR/LF" switch set to require both
carriage returns and line feeds, a 0x0d causes printing to resume at the
left margin of the current line, and 0x0a causes printing to resume at
the current column of the next line.

- --

Lew Pitcher, IT Consultant, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFBo4lFagVFX4UWr64RApNUAKDs1YdoaqQ8VC+pJVDMIL7jC/FIqACeLj7Q
DpeMHmi5BI0h3/U/E7AD18Q=
=ld8W
-----END PGP SIGNATURE-----