Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!ZRWA001%DTUZDV1.BITNET@wiscvm.wisc.EDU From: ZRWA001%DTUZDV1.BITNET@wiscvm.wisc.EDU (Helmut Waelder) Newsgroups: comp.lang.pascal Subject: TURBO Pascal READ Message-ID: <7061@brl-adm.ARPA> Date: Thu, 23-Apr-87 09:26:00 EST Article-I.D.: brl-adm.7061 Posted: Thu Apr 23 09:26:00 1987 Date-Received: Sat, 25-Apr-87 09:31:41 EST Sender: news@brl-adm.ARPA Lines: 27 Hi folks, I'm using TURBO Pascal 3.01A on a Tandon AT under MS-DOS 3.1 . The following program discovers a bug in turbos READ procedure: (*$R+,U+,B-*) (* I always use this directives *) program readbug; var r:real; a,b:char; begin readln(r,a,b); writeln(r:8:3,a,b); end. The input line contains a real number and two characters: 12.34 ET The output is: 12.340 E You will notice that the value of variable a is always a blank character and an input of: 12.34ET brings up an I/O error 10. So I think there must be always a blank after a read of a number. But is this standard pascal? A simple way out of this is to code readln(r,a,a,b); but it's not so easy to explain to the students in the programming course why they have to do this. Helmut Acknowledge-To: Helmut Waelder