home *** CD-ROM | disk | FTP | other *** search
- PROGRAM LISTER; {a simple program to add line numbers to a listing}
- {since it uses INPUT and OUTPUT for the files, you should run it like:
-
- { LISTER <INFILE >OUTFILE
- { or
- { LISTER <INFILE >PRN
- { to write to the printer.
- {you could try:
- { LISTER <LISTER to see this pgm. with line numbers.}
-
- VAR
- STR : STRING; {for the line coming in; 80 char max!}
- LINENUM : INTEGER;
-
- BEGIN
- LINENUM := 0;
- WHILE NOT EOF DO
- BEGIN
- LINENUM := LINENUM + 1;
- READLN(STR);
- WRITELN(LINENUM:4, ':', STR);
- END;
- END.