{The index to all of Carl Drott's Pascal examples is at:} { http://drott.cis.drexel.edu/CommandFinder.html } program LookOut; var aline, thename: string; linecount: integer; tohere: text; begin linecount := 0; writeln('what file do you want to see?'); readln(thename); {thename := oldfilename('Find file');} {should always check for null srtring} writeln; reset(tohere, thename); while not eof(tohere) do begin linecount := linecount + 1; readln(tohere, aline); writeln(aline); end; writeln; writeln('file ', thename, ' has ', linecount : 1, ' lines.'); end.