Scott Moore wrote:
That's true, but it has some drawbacks. First, you have to deal with different line endings yourself then. Second, it may be less comfortable, and also less efficient (reading a char vs. a line at a time).
Well, note that ISO 7185 has no construct for reading a line at a time, so its all off the standard in any case.
As you probably know, Extended Pascal is also a standard (ISO 10206) and it does provide a string type. You might not want to use it, but my objection was that I'd like to read files a line at a time in my programs, while noting the presence or absence of a trailing EOLn in the file, and it still stands. With EP means I could do it, except for the standards' EOLn semantics ...
I guess I have become biased. I created the idea of "file of char" bypass because I wanted to "have control", but I have since come to *love* the line ending filtering specified by the standard (and it was very much a creature of the standard, and not the original language). It simplifies code and regularizes line endings, even across multiple operating systems. It should be slow, but the common effect I have observed is that I can dump output much faster to a file than to the screen, which means that GUI output overwhelms the actual serial handling by orders of magnitude.
GUI output may well be slower, but I don't necessarily want to dump the whole file at once. In my text editor, I read the file and only dump a screenful until the user starts moving. So the reading speed is relevant.
Frank