Xref: utzoo comp.lang.pascal:1537 comp.sys.mac.programmer:4554 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!purdue!mentor.cc.purdue.edu!s.cc.purdue.edu!ags From: ags@s.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.pascal,comp.sys.mac.programmer Subject: Lightspeed Pascal 2.0 bug Keywords: read, get, Macintosh Message-ID: <3814@s.cc.purdue.edu> Date: 17 Feb 89 15:54:41 GMT Organization: Purdue University Lines: 29 Given the declarations var ff : text; v : char; The statement read(ff,v) is supposed to be exactly equivalent to v := ff^; get(ff) as stated in 6.9.1(b) of the American Pascal Standard and also in Chapter 17, paragraph 9.4.1.1 (page 310) of Think's Lightspeed Pascal User Manual. The implementation in Lightspeed Pascal 2.0 for the Macintosh, however, is broken. The statement turns out to have the same effect as v := ff^; if not eoln(ff) then get(ff) which means that on a nontrivial file you can read forever. Even Turbo Pascal 1.1 manages to get this one right! (I have cross-posted this to comp.lang.pascal because (a) it is not in any way Macintosh-related, and (b) to remind the people who keep posting MS-DOS-specific questions to that group that there is another world out there.) -- Dave Seaman ags@j.cc.purdue.edu