home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ipo-101.zip / Samples.zip / TYPE2.PAS < prev    next >
Pascal/Delphi Source File  |  1997-09-06  |  837b  |  33 lines

  1. (**************************************************************************
  2. ** This program copies characters from the input file to the standard output
  3. **
  4. ** Syntax: ivm type2 in
  5. **    where 'in' is the name of the input file.
  6. *)
  7. program type2(output);
  8. var
  9.    f : text;
  10.    c : char;
  11. begin
  12.    if paramcount <> 1 then
  13.       begin
  14.          writeln('Types the contents of the input file to the standard output');
  15.          writeln('Syntax:     ivm type2 in');
  16.          writeln('where ''in'' is the input file');
  17.          halt
  18.       end;
  19.    assign(f, paramstr(1));
  20.    reset(f);            (* Open 'in' *)
  21.    while not eof(f) do
  22.       if eoln(f) then
  23.          begin
  24.             readln(f);
  25.             writeln
  26.          end
  27.       else
  28.          begin
  29.             read(f, c);
  30.             write(c)
  31.          end
  32. end.
  33.