Path: utzoo!attcan!uunet!wuarchive!psuvax1!psuvm!psuecl!peg From: peg@psuecl.bitnet (PAUL E. GANTER) Newsgroups: comp.lang.modula2 Subject: HELP! seq. textfile reading screwy... Message-ID: <104618@psuecl.bitnet> Date: 13 Apr 90 03:30:23 GMT Organization: Engineering Computer Lab, Pennsylvania State University Lines: 33 Help, please! I am trying to read a sequential text file in Benchmark Modula 2 on an Amiga. I wante dto read a whole line at a time, so I wrote a ReadLine procedure (below). When I call this routine repeatedly, the same (first) line is read from the file each time. Can anyone explain why this is? I am not reopening the file each time, or using SetPos between ReadLine's. ReadLine is something like: x := 0 repeat readchar(infile,ch) line[x] := ch inc(x) until infile.eof or ch = lf line[x] := 0 the calling code is now (i simplified it): repeat readline(file,ln) writestring(ln) check for control c to save my butt! until file.eof Please e-mail any help, since I don't normally read this. Thanks! --Paul peg@psuecl.bitnet peg@psuecl.psu.edu