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

  1. (**************************************************************************
  2. ** This program copies characters from the input file to the output file.
  3. **
  4. ** Syntax: ivm type [in [out]]
  5. **    where 'in' is the name of the input file. If 'in' is omitted then
  6. **          the standard input stream is used.
  7. **    and  'out' is the name of the output file. If 'out' is omitted then
  8. **         the standard output stream is used.
  9. *)
  10. program typ(f, out);
  11. var
  12.    f, out : text;
  13.    c : char;
  14. begin
  15.    reset(f);            (* Open name or the standard input *)
  16.    rewrite(out);
  17.    while not eof(f) do
  18.       if eoln(f) then
  19.          begin
  20.             readln(f);
  21.             writeln(out)
  22.          end
  23.       else
  24.          begin
  25.             read(f, c);
  26.             write(out, c)
  27.          end
  28. end.
  29.