home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP07.EXE / CHP0701.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.4 KB  |  55 lines

  1. /*
  2.    Listing 7.1 Manifest Constant/#include Example
  3.    Author: Greg Lief
  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. //───── NOTE: must compile with the /N option!
  12.  
  13. #include "box.ch"
  14. #include "inkey.ch"
  15. #include "set.ch"
  16. #include "setcurs.ch"
  17. #include "misc.ch"
  18.  
  19. #define OFF .F.
  20.  
  21. function main
  22. local key, oldcursor := setcursor(SC_NONE)  // turn off cursor
  23. set(_SET_SCOREBOARD, OFF)
  24. set(_SET_CANCEL, OFF)
  25. cls
  26. @ 0, 0, 24, 79 box B_DOUBLE + ' ' color 'w/b'
  27. @ 6, 6, 18, 73 box B_SINGLE + ' ' color 'w/r'
  28. @ 11, 18, 13, 61 box B_SINGLE_DOUBLE + ' ' color '+w/rb'
  29. do while .t.
  30.    center(12, "Press a key - Esc to exit")
  31.    key := inkey(0)
  32.    scroll(12, 19, 12, 60, 0)
  33.    do case
  34.       case key == K_ENTER
  35.          center(12, "You pressed Enter")
  36.       case key == K_F1
  37.          center(12, "No help available")
  38.       case key == K_SH_F1
  39.          center(12, "Still no help available")
  40.       case key == K_ALT_A
  41.          center(12, "You pressed Alt-A")
  42.       case key == K_CTRL_Y
  43.          center(12, "You pressed Ctrl-Y")
  44.       case key == K_ESC
  45.          exit
  46.       otherwise
  47.          center(12, "Unknown keypress")
  48.    endcase
  49.    inkey(1)
  50. enddo
  51. setcursor(oldcursor)  // restore cursor
  52. return nil
  53.  
  54. // end of file CHP0701.PRG
  55.