Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!brl-adm!adm!jfjr@mitre-bedford.arpa From: jfjr@mitre-bedford.arpa Newsgroups: comp.lang.pascal Subject: Re: TURBO Pascal READ Message-ID: <7068@brl-adm.ARPA> Date: Thu, 23-Apr-87 13:46:18 EST Article-I.D.: brl-adm.7068 Posted: Thu Apr 23 13:46:18 1987 Date-Received: Sat, 25-Apr-87 06:44:43 EST Sender: news@brl-adm.ARPA Lines: 35 I noticed similar behavior and wrote about it to info-ibmpc last summer. MS-DOS screws up buffering input into pascal programs (turbo-pascal) at least. I wrote a simple program program test(input,output); var ch:char; begin writeln('enter character'); read(ch); writeln(ch); end. (its been a while since I wrote pascal so to anybody who will remark on any syntax/semantic errors rest assured those battles were fought last summer) If you compile and run this with Turbo (com option) and respond with a string say "abc", then the program will run correctly the first time, echoing an a. The second time you run it it will ignore you're input, whatever that may be and echo a 'b'. This will go on until the string 'abc' including cr and lf are consumed. I should back off a little. I havent tried it since last summer and turbo and/or MS-DOS might have been fixed since then but it drove me nuts then. The moral of this story (I have had similar input buffering problems with stdin in Micro-soft C) is that one should be very careful with standard input, console etc on an MS-DOS machine. By the way it didn't seem to matter what compiler options I chose Jerry Freedman,Jr