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

  1. /*
  2.    Listing 23.7 MEMOEDIT() user-defined function
  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. #include "MEMOEDIT.CH"
  12. #include "INKEY.CH"
  13. #include "SETCURS.CH"
  14.  
  15. function ME_UDF( me_mode,me_row,me_col )
  16. LOCAL keypress
  17. if me_mode = ME_UNKEY .or. ;  // MEMOEDIT.CH (Mode 1)
  18.    me_mode = ME_UNKEYX        // (Mode 2)
  19.    keypress := lastkey()      // Determine key pressed
  20.    do case
  21.    case keypress = K_INS      // Insert key
  22.       if readinsert()         // Is insert currently on?
  23.          setcursor(SC_NORMAL)    // Underline cursor
  24.       else
  25.          setcursor(SC_SPECIAL1)   // Full block cursor
  26.       endif
  27.       return K_INS            // Toggle cursor ON/OFF
  28.    case keypress = K_F5       // F5 - insert date
  29.       keyboard dtoc(date())   // Insert system date
  30.       return ME_DEFAULT
  31.    otherwise
  32.       return ME_DEFAULT       // Zero - default action
  33.    endcase
  34. endif
  35. return 0
  36.  
  37. // end of file CHP2307.PRG
  38.