home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / dbasel / 1181 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.5 KB  |  90 lines

  1. Newsgroups: bit.listserv.dbase-l
  2. Path: sparky!uunet!uunet.ca!canrem!dosgate!dosgate![tom.frazer@canrem.com]
  3. From: "tom frazer" <tom.frazer@canrem.com>
  4. Subject: on key search routine
  5. Message-ID: <1992Nov12.4772.1819@dosgate>
  6. Reply-To: "tom frazer" <tom.frazer@canrem.com>
  7. Organization: Canada Remote Systems
  8. Distribution: bit
  9. Date: 12 Nov 92 03:10:12 EST
  10. Lines: 78
  11.  
  12. To: thamilto@PCOCD2.INTEL.COM
  13.  
  14.  <Continued from previous message>
  15.  
  16.    ** Cursor movement keys
  17.    IF "" # matchstr
  18.       matchstr = ""
  19.       DO keydisp WITH ""
  20.    ENDIF
  21.    IF userpress = 25
  22.       ** Ctrl-Y clears input string but preserves current record position
  23.       ON KEY DO keyhand
  24.    ELSE
  25.       ** Stuff the keyboard buffer with cursor key to move record position
  26.       CALL keybd WITH CHR(userpress)+CHR(trapkey)
  27.       ON KEY LABEL home DO keyhand
  28.    ENDIF
  29. OTHERWISE
  30.    ** Search for input string
  31.    recnum = RECNO()
  32.    DO CASE
  33.    CASE userpress = 19 ;
  34.          .OR. userpress = 127
  35.       ** Backspace or Left arrow erases one character
  36.       matchstr = SUBSTR(matchstr,1,LEN(matchstr)-1)
  37.       newstr = matchstr
  38.    OTHERWISE
  39.       newstr = matchstr + CHR(userpress)
  40.    ENDCASE
  41.    
  42.    SEEK UPPER(newstr)
  43.    
  44.    IF FOUND()
  45.       matchstr = newstr
  46.       DO keydisp WITH matchstr
  47.       ************************************************************
  48.       * In dBASE IV 1.0, Browse will not automatically reposition
  49.       * screen UNLESS you move the cursor.
  50.       * In dBASE IV 1.1, you do not need to do this.
  51.       * **********************************************************
  52.       IF db1_0 .AND. recnum # RECNO()
  53.          CALL keybd WITH CHR(5) + CHR(trapkey)    && UP/trapkey
  54.          ON KEY LABEL home DO keyhand
  55.       ELSE
  56.          ON KEY DO keyhand
  57.       ENDIF
  58.    ELSE
  59.       *** No Match
  60.       ? CHR(7)        && Beep
  61.       GOTO recnum
  62.       ON KEY DO keyhand
  63.    ENDIF
  64. ENDCASE
  65. RETURN
  66.  
  67. *!*********************************************************************
  68. *!
  69. *!      Procedure: KEYDISP
  70. *!
  71. *!      Called by: KEYHAND        (procedure in BROWDEMO.PRG)
  72. *!
  73. *!*********************************************************************
  74. PROCEDURE keydisp
  75. PARAMETER dispstr
  76. ****************************************
  77. * Display the current input string
  78. ****************************************
  79. ACTIVATE WINDOW inwin
  80. CLEAR
  81. ? dispstr
  82. ACTIVATE WINDOW browwin
  83. RETURN
  84. *: EOF: BROWDEMO.PRG
  85. ---
  86.  . MegaMail 2.10: Toronto Blue Jays 1992 World Series CHAMPIONS!
  87. --
  88. Canada Remote Systems  - Toronto, Ontario
  89. World's Largest PCBOARD System - 416-629-7000/629-7044
  90.