Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!uafhp!nwark!FredMail From: Alex.Brown@f1020.n391.z1.FidoNet.Org (Alex Brown) Newsgroups: comp.lang.pascal Subject: Overflow error Message-ID: <675648024.0@nwark.FidoNet> Date: 31 May 91 00:45:00 GMT Sender: FredMail@p0.f1060.n391.z1.FidoNet.Org Lines: 65 I am getting an overflow error after 3 pages are displayed. Can any tell why and how to avoid it in the future. The program is supposed to grab 24 lines of a text and display them with a >>>>>>>MORE<<<<<<<< message at the bottom. Program View; uses dos, crt; var ftext : text; f : integer; s : array[1..25] of string; procedure showpage; begin f := 1; while f < 25 do begin writeln(s[f]); inc(f); end; end; procedure getstring; begin f := 1; while (not eof(ftext)) and (f < 25) do begin readln(ftext, s[f]); inc(f); end; if not eof(ftext) then begin s[25] := ' >>>>>>>>MORE<<<<<<<< '; showpage; readln; end; getstring; end; begin if paramcount <> 1 then begin writeln('Syntax is VIEW "filename" '); halt; end; assign(ftext,paramstr(1)); reset(ftext); getstring; close(ftext); end. --- * Origin: The Ozark Connection/Fayetteville, AR * (1:391/1020)