home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / keylock.zip / TST.PRG < prev   
Text File  |  1988-08-25  |  1KB  |  42 lines

  1. *
  2. * Toggle and inquire state of keys from Clipper Summer 87
  3. *
  4. * This simple demo will show the use of KEYLOCK.ASM
  5. * The file KEYLOCK.OBJ (included in archive) must be linked along with
  6. * your program (in this case TST.PRG)
  7. *
  8. * Compile: CLIPPER TST
  9. * Link:    TLINK /x/n tst keylock,,,clipper        <-- Turbo C linker
  10. * or       LINK tst+keylock,,,clipper /SE:256      <-- Microsoft linker
  11. *
  12. CLEAR
  13. ? "Test KEYLOCK.ASM demo:"
  14. ? "It shows the use of functions LOCKSTAT() INSTOGG() CAPTOGG() NUMTOGG() SCRTOGG()"
  15. ?
  16. ? "Press [I][N][C][S] to see the toggles. [ESC] to exit."
  17. ?
  18. DO WHILE .T.
  19.    x = LOCKSTAT()
  20.    @ 10,0 say "INSERT is: " + IF(SUBSTR(x,1,1) == "I", "on <-", "off  ")
  21.    @ 11,0 say "CAPS   is: " + IF(SUBSTR(x,2,1) == "C", "on <-", "off  ")
  22.    @ 12,0 say "NUM    is: " + IF(SUBSTR(x,3,1) == "N", "on <-", "off  ")
  23.    @ 13,0 say "SCROLL is: " + IF(SUBSTR(x,4,1) == "S", "on <-", "off  ")
  24.    INKEY(0)
  25.    l_key = CHR(LASTKEY())
  26.    DO CASE
  27.    CASE l_key = CHR(27)
  28.       EXIT
  29.    CASE l_key = "I" .OR. l_key = "i"
  30.       INSTOGG()
  31.    CASE l_key = "C" .OR. l_key = "c"
  32.       CAPTOGG()
  33.    CASE l_key = "N" .OR. l_key = "n"
  34.       NUMTOGG()
  35.    CASE l_key = "S" .OR. l_key = "s"
  36.       SCRTOGG()
  37.    ENDCASE
  38. ENDDO .T.
  39. QUIT
  40.  
  41. * EOF
  42.