Laurence

In very strict terms the difference between the action of a Line Feed (LF)
character and a New Line (NL) character is that the action of a Carriage
Return (CR) is missing in the case of an LF character and present in the
case of the NL character.

You got the answer from the other two appends I have seen until now, but
I'll expand on what I just said in an effort to be as clear as I can.

Let us assume that somewhere along a line of print in the course of being
printed, the printer, whatever type of printer it is, has to handle one of
these characters: LF, CR or NL.

If the character is an LF, the printer arranges to start printing any
following graphic characters, that is, characters which cause something to
print rather than having a special purpose such as the three characters
under discussion, on the following line but starting at exactly the position
of the last character to be printed on the current line. Thus if 25
characters have already printed on the current line, there will be 25 blank
spaces on the left of the following line before any graphic characters can
appear.

If the character is a CR, the printer arranges to print any following
graphic characters starting at the left margin of the current line,
potentially overwriting characters which have already been printed.

If the character is an NL, the printer arranges to print any following
graphic characters starting at the left margin of the following line.

Note that, if an LF is followed immediately by a CR or, in the more usual
order, a CR is followed immediately by an LF, the action taken by the
printer will be identical to that taken for an NL.

The basic ASCII character set identifies a CR and an LF character and you
will tend to find ASCII data streams perform formatting of a printed page
using these two characters and, typically CRLF simply to begin a new line of
print. Clearly CR used by itself has potential for underlining and rendering
characters in bold "type". NL used by itself may have a role where the
layout of the page allows but this will not be very common as you can
imagine. In the days when data needed to be transmitted and line speeds of,
say, 300 bps had to be tolerated, using all the tricks at one's disposal to
help get a report printed as quickly as possible might involve NL and BS,
backspace, but the processing required to spot how to create the data stream
would be tricky.[1]

The SNA character string has all of the NL (X'15') character, as well as CR
(X'25') and LF (X'0D').

Now, I've just spotted something odd which may be the reason for your post.
In the "SNA Formats" manual, GA27-3136-20[2], in Appendix A, "SNA Character
Sets and Symbol-String Types", which you'd expect to be the model of
clarity, X'15' is identified as Line Feed - confusion worse confounded. Just
ignore it. It's wrong. I wonder if there is anyone still reading who has
access to anyone who might know the authors who can justify this nonsense.
What I described above is what I have taught and shown to work in
environments such as Unformatted Systems Services in VTAM, with both "pure"
SNA devices and, more importantly, with devices which require an EBCDIC
translation of ASCII characters.

Incidentally NVT, initials used in one of the reply posts, means "Network
Virtual Terminal" and is used in TELNET RFCs in order to define a generic
device. From RFC 854, "An NVT is an imaginary device which provides a
standard,network-wide, intermediate representation of a canonical terminal."

[1] I once wrote some APL functions to maximise the use of TAB characters in
order to speed up report printing at 300 bps. The very next release of VM
APL introduced a standard function to perform precisely the same result. :-(

[2] http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/d50a5007

Chris Mason

----- Original Message ----- 
From: "Tsai Laurence" <[EMAIL PROTECTED]>
Newsgroups: bit.listserv.ibm-main
To: <IBM-MAIN@BAMA.UA.EDU>
Sent: Monday, 04 September, 2006 3:14 PM
Subject: what's the difference between LF(Line Fee) and NL (New line) ?


> hello listers,
>   I am confused that the difference between LF & NL ? It seems both will
> get the printer prints the document on next line .
> Can anybody advise me ?
>
> Sincerely,
> Laurence

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to