Re: IDE - declarations and so on?
- Posted by Derek Parnell <ddparnell at bigpond.com> May 22, 2001
- 420 views
----- Original Message ----- From: <david at aldred.demon.co.uk> To: "EUforum" <EUforum at topica.com> Subject: Re: IDE - declarations and so on? > Thanks. They seem to have turned those two round for this control, > don't they? I don't think I've ever seen /r/n rather than /n/r used > before! Actually David, Carriage-Return/New-Line is the normal sequence and has been since before computers were around. The reason is that in the days of mechanical output devices such as teletype machines, the #0D (ascii-13) control command was sent to the device to "return the carriage", that is the print head, back to the left hand edge of the paper. While it was travelling back to the left edge, the #0A (ascii-10) control command was sent to the device to move the paper up one line. This was done to optimise the output speed. If it was done the other way round, linefeed then carriage return, the device would move the paper up one line (a fast operation) and then move the carriage (a slow operation) and the device would block printing until the carriage was settled again. In fact, some printers would not block, so printing would commence while the carriage was still travelling back to the start of the next line - not a desirable thing. So, Microsoft, trying not to be inovative I suppose, programmed MS-DOS screen handling to emulate a teletype device. A #0D will move the cursor to the left hand edge of the screen, and a #0A will move the cursor down one line, scolling up if its at the bottom of the screen. They applied this convention to text files to simplify the device driver when display text files. The Unix creators decided that only a #0A is required to denote the end of a text line and left it up to the device drivers to do the correct thing in manipulating the display of text. As most Unixes were using dumb terminals, which also emulated teletypes, the Unix device drivers would automatically output a #0D just before sending the #0A from the text file to the terminal (or printer). To make things worse, Microsoft has some Windows controls using a simple #0A (message box for example) and other still needing the CRLF sequence. ------ Derek Parnell Melbourne, Australia "To finish a job quickly, go slower."