program FLIST (input, tty); { list a file with line numbers } var filename: array[1..20] of char; lineno: integer; i: integer; c: char; begin write (tty, 'Enter name of file to be listed: '); break; readln(tty); filename := ' '; i := 1 while not eoln(tty) do begin read(tty, filename[i]); i := i + 1 end; reset ( input, filename ); lineno := 0 ; while not eof(input) do begin lineno := lineno + 1 ; write (tty, lineno:4, ' '); i := 5; { current column } while not eoln(input) do begin read (input, c); i := i + 1 ; if i <= 79 then write (tty, c) end; readln (input); writeln (tty) end end.