home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBII / DEMOS / DEMOSWAP.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-03-08  |  657 b   |  28 lines

  1. uses
  2.   dos, eco_swap
  3.  
  4.   ; { keep eco_swap last }
  5.  
  6.  
  7. type                            { use some memory, give exec something to do! }
  8.   ar64 = array[0..65520] of byte;
  9.   arar = array[1..8] of ^ar64;
  10.  
  11. var
  12.   status : word;
  13.   ar     : arar;
  14.  
  15. begin
  16.   for status := 1 to 8 do new(ar[status]);
  17.   useemsifavailable := true;
  18.   if not initexecswap(heapptr, 'SWAP.$$$') then
  19.     writeln('Unable to allocate swap space')
  20.   else begin
  21.     writeln('Allocated ', bytesswapped, ' bytes ', swaploc[emsallocated]);
  22.     swapvectors;
  23.     status := execwithswap(getenv('COMSPEC'), '');
  24.     swapvectors;
  25.     writeln('Exec status: ', status);
  26.   end;
  27. end.
  28.