Re: New line in a JTextArea (student learning here)



RedGrittyBrick wrote:
Is "move to start of next line" intrinsically two operations?

A-priori design considerations aside, it factually /was/ two operations on the historic teleprinters for which ASCII was first designed. (IBM Selectric teleprinters, such as the 1052 and the 2741, had a combined operation, and EBCDIC has a distinct "New-line" control character, in addition to "Line-feed" and "Carriage-return".)

The reason that historic teleprinters combined the operations is very likely the requirement for all operations to take place in one character time. They had very narrow margins, and could do a carriage return in the time it took to print one character; I suspect that adding the line feed while retaining the speed would have significantly increased costs. (IBM Selectric teleprinters could /not/ execute either a Carriage-return or a New-line in one character time, both because they had wider carriages and because they printed at nearly twice the character rate; it was necessary to insert a number of Idle [do-nothing] control characters to prevent the printer from trying to strike characters while flying back. Same for tabs.)

More so than "move to column 1 row 11"? I wouldn't be surprised if the latter is what many curses applications end up sending to the terminal when the user presses the Enter key.

ASCII is much older than curses. Indeed, when ASCII was being developed, CRT terminals were hideously expensive and vector-based (like the old "Asteroids" arcade game), and required a whole mainframe to drive them. They were almost entirely limited to CAD, Air Traffic Control, and similar applications.

--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
.



Relevant Pages

  • Re: what does "serialization" mean?
    ... Sorry eddie, but you're dead wrong there as usual. ... >>How about ASCII character 0xB0, ... > Totalitarians and Fascists are often self-appointed language police. ...
    (comp.programming)
  • Re: what does "serialization" mean?
    ... > attempt to present myself as an authority on any and every topic I have ... >> survived and EBCDIC did not because ASCII properly sequenced letters. ... > How about ASCII character 0xB0, ... >> must assert negative facts, for all he knows is there is no knowledge ...
    (comp.programming)
  • Re: Cohens paper on byte order
    ... I think you're using "ASCII" in a notional sense. ... a good reason to teach the *opposite* convention, ... Computers should be as easy to understand as is possible _without_ ... arithmetic on character strings ...
    (sci.crypt)
  • Re: Reading a file.
    ... your program will interpret them as ASCII. ... Bruce.Eitman AT EuroTech DOT com ... buffer is character values, then in memory ASCII values are displayed. ... DWORD d = GetLastError; ...
    (microsoft.public.windowsce.app.development)
  • Re: Get ASCII values for PC arrow keys?
    ... those responsible for standards usually do attempt ... ASCII is a character set, ... ISO/IEC registry for character sets for them to receive identifying ...
    (alt.comp.lang.learn.c-cpp)