home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 502b.lha / PCQ_v1.2 / PCQ_Examples / examples.LZH / Examples / Typer.p < prev    next >
Text File  |  1990-07-18  |  613b  |  31 lines

  1. Program Typer;
  2.  
  3. {
  4.     Demonstrates the use of the PCQ Pascal IO routines by
  5.     implementing something like the AmigaDOS TYPE command.
  6. }
  7.  
  8. var
  9.     Infile : Text;
  10.     InfileName : String;
  11.  
  12. {$I "Include:Utils/StringLib.i"}
  13. {$I "Include:Utils/Parameters.i"}
  14.  
  15. begin
  16.     InfileName := AllocString(80);
  17.     GetParam(1, InfileName);
  18.     if InfileName^ = Chr(0) then begin
  19.     Writeln('No filename specified');
  20.     Exit(10);
  21.     end;
  22.     if reopen(InfileName, Infile) then begin
  23.     while not eof(Infile) do begin
  24.         write(Infile^);
  25.         get(Infile);
  26.     end;
  27.     close(Infile);
  28.     end else
  29.     writeln('Could not open the input file.');
  30. end.
  31.