Path: utzoo!attcan!uunet!husc6!mailrus!ncar!oddjob!gargoyle!att!chinet!edlee From: edlee@chinet.chi.il.us (Edward Lee) Newsgroups: comp.lang.pascal Subject: Re: EOF in TP4? Message-ID: <6247@chinet.chi.il.us> Date: 8 Aug 88 06:56:59 GMT References: <5126@killer.DALLAS.TX.US> Reply-To: edlee@chinet.chi.il.us (Edward Lee) Organization: Chinet - Public Access Unix Lines: 35 In article <5126@killer.DALLAS.TX.US> rcj@killer.DALLAS.TX.US (Robert Johnson) writes: >What is the best way of reading a file, and then determinign when you >have reached the end of it in TP4.0? I have tryed a while not EOF >loop, but to no avail...I desperately need this! If you have a while-not-EOLN loop within a while-not-EOF loop, I suggest that you change the "not EOLN(file)" to "not ( EOLN(file) or EOF(file) )". For example: while not eof(file) do begin . . . while not eoln(file) do { MAKE: "while not( eoln(file) or eof(file) ) do"} begin . . . end; . . . end; { The last EOLN of a file can also be the EOF, so if only EOLN is checked in the inner loop, then the EOF check in the outer loop may fail. I had this problem with Watcom Pascal, involving an outer while-not-EOF with an inner repeat- until-EOLN loop, which I had to change to a repeat-until-EOLN-or-EOF loop. -Ed L }