home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP10.EXE / CHP1001.PRG < prev   
Encoding:
Text File  |  1991-04-30  |  1.0 KB  |  37 lines

  1. /*
  2.    Listing 10.1 Display memory status in a pop-up box.
  3.    Author: Craig Yellick
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. function DispMem(n)
  12. /*
  13.    Display available memory stats.
  14.    Return .T. if it falls below specified level (optional).
  15.  
  16.    Debugger command line examples:
  17.  
  18.      ? dispmem()      // Display memory status box
  19.      tp dispmem(125)  // Halt when memory falls below 125 kb
  20. */
  21. local clr
  22.   if n = nil
  23.     clr := setcolor("W+/R")
  24.     @ 10, 40 to 16, 61 double
  25.     @ 11, 41 say "Memory Status     Kb"
  26.     @ 12, 41 say "--------------------"
  27.     @ 13, 41 say "Total available " +str(memory(0),  4)
  28.     @ 14, 41 say "Largest block   " +str( memory(1), 4)
  29.     @ 15, 41 say "RUN area        " +str(memory(3),  4)
  30.     inkey(0)
  31.     setcolor(clr)
  32.     n := 0
  33.   endif
  34. return (memory(0) < n)
  35.  
  36. // end of file CHP1001.PRG
  37.