Re: New line in a JTextArea (student learning here)
- From: Wojtek Bok <wb@xxxxxxxxxx>
- Date: Tue, 30 Jan 2007 21:26:23 GMT
RedGrittyBrick wrote:
Wojtek Bok wrote:Andrew Thompson wrote:OTOH, using System.getProperty("line.separator"),
is 'forward compatible' in the sense that if any new
OS architectures were to become support, or either
Win/*nix to suddenly change the line separator
(my bet would be Windows), the code would adapt.
Actually *nix should change. The action of moving the cursor to the beginning of a new line is in fact two operations:
Two? How many buttons on your keyboard do you normally press to accomplish this?
I do not have a CRLF button on my keyboard any more than I have a CR or an LF button. I do have an Enter button though. And the pretty graphic shows:
|
<----|
Which looks like two operations to me.
Oh, and the print screen button scrapes the screen, copies the result into a buffer, then prints the buffer. Pretty complex for one little button.
:-)
- move the cursor down one line
- move the cursor to the beginning of the line
Only for electromechanical teletypewriter machines that supported overprinting and underlining that way. (and their successors that try to be backwards compatible with carriage-control from the days when a carriage was a large lump of metal driven by separate motors for rotation/feed and for horizontal positioning).
Yes, but it seemed to be a natural thing, as you do have two things happen.
So the original DOS specification of CRLF is correct,
Carriage control CR LF long predates DOS so I'm not sure why you picked that as an example. The Unix LF convention was established before DOS existed.
Well, I started with DOS 1.0, so that comes naturally for me.
The DOS specification for line separation/termination wasn't original - in the sense of being novel, and it wasn't original - in the sense of being first.
CR LF is only "correct" in the sense of being "traditional".
The ASCII standards didn't define a character or sequence for "line separator" or "line terminator" in stored files.
True, though for a text file dumped to a screen you do want new lines to start at the beginning of screen, one line down. This is two operations.
Which is why ASCII does have two specifications CR and LF.
Now as for separating information within a file (such as lines), you could use anything, as long as the file reader interprets it correctly.
.
- Follow-Ups:
- Re: New line in a JTextArea (student learning here)
- From: RedGrittyBrick
- Re: New line in a JTextArea (student learning here)
- References:
- New line in a JTextArea (student learning here)
- From: Sandy
- Re: New line in a JTextArea (student learning here)
- From: Knute Johnson
- Re: New line in a JTextArea (student learning here)
- From: Sandy
- Re: New line in a JTextArea (student learning here)
- From: Farcus Pottysqirt
- Re: New line in a JTextArea (student learning here)
- From: Andrew Thompson
- Re: New line in a JTextArea (student learning here)
- From: Knute Johnson
- Re: New line in a JTextArea (student learning here)
- From: Andrew Thompson
- Re: New line in a JTextArea (student learning here)
- From: Wojtek Bok
- Re: New line in a JTextArea (student learning here)
- From: RedGrittyBrick
- New line in a JTextArea (student learning here)
- Prev by Date: Re: Is there an easy way to find the right class?
- Next by Date: Re: Is there an easy way to find the right class?
- Previous by thread: Re: New line in a JTextArea (student learning here)
- Next by thread: Re: New line in a JTextArea (student learning here)
- Index(es):