CompuServe Thread

#Pascal problem

2 messages in this thread
#13081From: Bela Lubkin/SysopMar 30, 1986 5:01 AM
Jan, that's not a bug in Pascal. The language standard says that when you're reading input, the only thing that will go to the next line of input is a ReadLn. A Read reads from the current buffer. A ReadLn reads from the current buffer, then flushes the buffer and reads in a new one. So if you While Not EOLN Do Begin Read(This); DoSomethingWith(This); End; Then you will have read all the data from the current buffer, and will be sitting at the end of the buffer. To move to the next input line, you must ReadLn — effectively, read the CR at the end of the buffer. – Bela * Reply: 13117
#13117From: Jan HarringtonMar 30, 1986 6:45 AM
Bela, thanx for the info. I always wondered why you had to issue that extra readln. jan * RR 13081