home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / chademo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-11-22  |  960 b   |  31 lines

  1. {
  2.  This simple program demonstrates the use of the CHAIN unit.
  3.  After compiling DEMO, call it with two command line parameters.
  4.  The first parameter is the full name of the program to execute,
  5.  including extension and path, if any. The second parameter is a
  6.  command line to pass on to the program. Note that only one word
  7.  of the command line is passed on, in the interests of simplicity.
  8.  
  9.  An interesting case to try is:
  10.    DEMO DEMO.EXE DEMO.EXE
  11. }
  12. program demo;
  13. uses
  14.   chain;
  15. var
  16.   status:word;
  17. begin
  18.   writeln('Turbo 4.0 Chaining Demonstration, by TurboPower Software');
  19.   if paramcount < 1 then begin
  20.     writeln('Usage: DEMO ProgramToChainTo CommandLineToPass');
  21.     halt;
  22.   end;
  23.   status:=chain4(paramstr(1),paramstr(2));
  24.   case status of
  25.     2:writeln('file "',paramstr(1),'" not found');
  26.     8:writeln('insufficient memory');
  27.     30:writeln('error reading ',paramstr(1));
  28.     152:writeln('drive not ready');
  29.   end;
  30. end.
  31.