DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦163822619⟧ TextFile

    Length: 2048 (0x800)
    Types: TextFile
    Names: »PRINT.PAS«

Derivation

└─⟦8036278f9⟧ Bits:30009789/_.ft.Ibm2.50006588.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »PRINT.PAS« 

TextFile

program print;

(* Used for printing out text files on the printer.
   The program is called in this way:
          PRINT file header
   The "header" may include blanks.
     The file is printed with 60 lines per page, line
   numbers to the left, and on top of each page is
   printed the name of the file and the "header". This
   header can for example be the current date and time.
     Tabs are not expanded.                               *)


label 9999;

const FF = 12; (* linefeed *)

var infile : text;
    lst : text;

    args : string(.128.);
    fileName : string(.20.);
    header : string(.128.);

    lineNo : integer;

    line : string(.255.);

begin
  getcomm(args);

  while pos(' ', args) = 1 do delete(args, 1, 1);
  if args = '' then begin
    writeln('Kald : print filnavn overskrift....');
    goto 9999;
  end;
  insert(' ', args, length(args)+1);
  fileName := copy(args, 1, pos(' ', args)-1);
  delete(args, 1, pos(' ', args));
  while pos(' ', args) = 1 do delete(args, 1, 1);
  header := args;
  if header <> '' then
    while header(.length(header).) = ' ' do
      delete(header, length(header), 1);

  if not checkfn(fileName) then begin
    writeln('Fejl i filnavnet: ', fileName);
    goto 9999;
  end;
  if not fstat(fileName) then begin
    writeln('Filen findes ikke: ', fileName);
    goto 9999
  end;
  assign(infile, fileName);
  reset(infile);

  assign(lst, 'LST:');
  rewrite(lst);
  lineNo := 0;

  while not eof(infile) do begin
    readln(infile, line);
    lineNo := lineNo+1;
    if lineNo mod 60 = 1 then begin
      if lineNo > 1 then page(lst);
      writeln(lst, '      ', fileName,
                   ' ' : 25-length(fileName), header);
      writeln(lst);
      writeln(lst);
    end;
    writeln(lst, lineNo:4, '  ', line);
  end;

  page(lst);
  close(infile);
  close(lst);
9999:
end.
«eof»