Task

Cause a line printer attached to the computer to print a line containing the message:    Hello World! 



Note

A line printer is not the same as standard output.

A   line printer   was an older-style printer which prints one line at a time to a continuous ream of paper.

With some systems, a line printer can be any device attached to an appropriate port (such as a parallel port).




program testprn;
uses printer;
var i: integer;
    f: text;
begin
  writeln ( 'Test of printer unit' );
  writeln ( 'Writing to lst ...' );
  for i := 1 to 80 do
    writeln ( lst, 'This is line', i, '.' #13 );
  close ( lst );
  writeln ( 'Done.' );
  {$ifdef Unix }
  writeln ( 'Writing to pipe ...' );
  assignlst ( f, '|/usr/bin/lpr −m' );
  rewrite ( f );
  for i:= 1 to 80 do
    writeln ( f, 'This is line ', i, '.'#13 );
  close ( f );
  writeln ( 'Done.' )
  {$endif}
end.