home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 7.1 Manifest Constant/#include Example
- Author: Greg Lief
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- #include "box.ch"
- #include "inkey.ch"
- #include "set.ch"
- #include "setcurs.ch"
- #include "misc.ch"
-
- #define OFF .F.
-
- function main
- local key, oldcursor := setcursor(SC_NONE) // turn off cursor
- set(_SET_SCOREBOARD, OFF)
- set(_SET_CANCEL, OFF)
- cls
- @ 0, 0, 24, 79 box B_DOUBLE + ' ' color 'w/b'
- @ 6, 6, 18, 73 box B_SINGLE + ' ' color 'w/r'
- @ 11, 18, 13, 61 box B_SINGLE_DOUBLE + ' ' color '+w/rb'
- do while .t.
- center(12, "Press a key - Esc to exit")
- key := inkey(0)
- scroll(12, 19, 12, 60, 0)
- do case
- case key == K_ENTER
- center(12, "You pressed Enter")
- case key == K_F1
- center(12, "No help available")
- case key == K_SH_F1
- center(12, "Still no help available")
- case key == K_ALT_A
- center(12, "You pressed Alt-A")
- case key == K_CTRL_Y
- center(12, "You pressed Ctrl-Y")
- case key == K_ESC
- exit
- otherwise
- center(12, "Unknown keypress")
- endcase
- inkey(1)
- enddo
- setcursor(oldcursor) // restore cursor
- return nil
-
- // end of file CHP0701.PRG
-