home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxfmem.zip / rxfmem.txt < prev    next >
Text File  |  1998-12-05  |  1KB  |  36 lines

  1. This REXX extension DLL returns the system's free memory, either physical 
  2. or virtual.  The returned string will be an integer from 524288 to 
  3. 4294967295. 
  4.  
  5. For whatever reason, OS/2 doesn't return less than 512K free memory 
  6. (perhaps it actually keeps that much free as a buffer).
  7.  
  8. To use, put this in your REXX script:
  9.  
  10. call RxFuncAdd 'RxFreeMem','RxFMem','RxFreeMem'
  11.  
  12. You may then call RxFreeMem().
  13.  
  14. The function takes either one argument, or no argument.  
  15.  
  16. The valid arguments are 'Virtual' and 'Physical', case-insensitive.  The 
  17. first letter alone is also sufficient.
  18.  
  19. The default if no argument is given is to return physical memory.
  20.  
  21. Examples:
  22.  
  23. say 'Physical memory free: '||RxFreeMem()
  24. say 'Virtual memory free: '||RxFreeMem('v')
  25. say 'Physical memory free: '||RxFreeMem('Physical')
  26.  
  27. Non-valid arguments will cause a syntax error.
  28.  
  29. Free physical memory is determined by the Dos16MemAvail() API call (which 
  30. is undocumented, and not declared in VACPP's headers, strangely enough).
  31.  
  32. Free virtual memory is determined by a DosQuerySysInfo() API call, using 
  33. the QSV_TOTAVAILMEM identifier.
  34.  
  35. The source and module definition file are in the source.zip archive.
  36.