home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 23.7 MEMOEDIT() user-defined function
- 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
- */
-
- #include "MEMOEDIT.CH"
- #include "INKEY.CH"
- #include "SETCURS.CH"
-
- function ME_UDF( me_mode,me_row,me_col )
- LOCAL keypress
- if me_mode = ME_UNKEY .or. ; // MEMOEDIT.CH (Mode 1)
- me_mode = ME_UNKEYX // (Mode 2)
- keypress := lastkey() // Determine key pressed
- do case
- case keypress = K_INS // Insert key
- if readinsert() // Is insert currently on?
- setcursor(SC_NORMAL) // Underline cursor
- else
- setcursor(SC_SPECIAL1) // Full block cursor
- endif
- return K_INS // Toggle cursor ON/OFF
- case keypress = K_F5 // F5 - insert date
- keyboard dtoc(date()) // Insert system date
- return ME_DEFAULT
- otherwise
- return ME_DEFAULT // Zero - default action
- endcase
- endif
- return 0
-
- // end of file CHP2307.PRG
-