home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / demo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-10-23  |  1.1 KB  |  42 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.  
  13. program demo;
  14.  
  15. uses
  16.   chain;
  17.  
  18. var
  19.   status:word;
  20.  
  21. begin
  22.   writeln;
  23.   writeln('Turbo Chaining Demonstration, by TurboPower Software');
  24.   if paramcount < 1 then begin
  25.     writeln('Usage: DEMO ProgramToChainTo CommandLineToPass');
  26.     halt;
  27.   end;
  28.  
  29.   writeln('memavail:',memavail);
  30.   writeln('setting max heap to 20000 bytes');
  31.   setmaxheap(20000);
  32.   writeln('memavail:',memavail);
  33.  
  34.   status:=chain4(paramstr(1),paramstr(2));
  35.   case status of
  36.     2:writeln('file "',paramstr(1),'" not found');
  37.     8:writeln('insufficient memory');
  38.     30:writeln('error reading ',paramstr(1));
  39.     152:writeln('drive not ready');
  40.   end;
  41. end.
  42.