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

  1. (*
  2. ** This program is a primitive batch processor.
  3. ** It sends each line in the input file to the command processor.
  4. *)
  5. program batch(f, output);
  6. var
  7.    f : text;
  8.    s : string;
  9.    err : integer;
  10. begin
  11.    reset(f);    (* open input file or standard input file *)
  12.    while not eof(f) do
  13.       begin
  14.          readln(f, s);
  15.          writeln('Executing ', s);
  16.          err := system(s);      (* Pass 's' to the command processor *)
  17.          writeln('Error code is ', err)
  18.       end
  19. end.
  20.