home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / GKLIST.PRG < prev    next >
Encoding:
Text File  |  1991-07-01  |  1.2 KB  |  53 lines

  1. /*
  2.     Function: GKeyList()
  3.     Purpose:  Alternate for GetApplyKey()
  4.               for list clause
  5.     Author:   Greg Lief
  6.     Copyright (c) 1991 Greg Lief
  7.     Dialect:  Clipper 5.01
  8. */
  9.  
  10. #include "inkey.ch"
  11. #include "getexit.ch"
  12.  
  13. #define VALUES        get:cargo[3]
  14. #define POINTER       get:cargo[4]
  15.  
  16. procedure gkeylist(get, key)
  17. local cKey
  18. local oldvalue
  19.  
  20. //───── check for SET KEY and basic movement keys
  21. if ! GKeyBasic(get, key)
  22.  
  23.    do case
  24.  
  25.       case (key == K_CTRL_U)
  26.          get:Undo()
  27.  
  28.       case (key == K_BS)
  29.          if POINTER == 1
  30.             POINTER := len(VALUES)
  31.          else
  32.             POINTER--
  33.          endif
  34.          //───── must pad the buffer to maximum length so as to
  35.          //───── avoid leftover flotsam from previous item
  36.          get:varPut(padr(VALUES[POINTER], len(get:picture)))
  37.          get:updateBuffer()
  38.  
  39.       case (key == 32)
  40.          if POINTER == len(VALUES)
  41.             POINTER := 1
  42.          else
  43.             POINTER++
  44.          endif
  45.          //───── must pad the buffer to maximum length so as to
  46.          //───── avoid leftover flotsam from previous item
  47.          get:varPut(padr(VALUES[POINTER], len(get:picture)))
  48.          get:updateBuffer()
  49.  
  50.    endcase
  51. endif
  52. return
  53.