home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: bit.listserv.dbase-l
- Path: sparky!uunet!uunet.ca!canrem!dosgate!dosgate![tom.frazer@canrem.com]
- From: "tom frazer" <tom.frazer@canrem.com>
- Subject: on key search routine
- Message-ID: <1992Nov12.4772.1819@dosgate>
- Reply-To: "tom frazer" <tom.frazer@canrem.com>
- Organization: Canada Remote Systems
- Distribution: bit
- Date: 12 Nov 92 03:10:12 EST
- Lines: 78
-
- To: thamilto@PCOCD2.INTEL.COM
-
- <Continued from previous message>
-
- ** Cursor movement keys
- IF "" # matchstr
- matchstr = ""
- DO keydisp WITH ""
- ENDIF
- IF userpress = 25
- ** Ctrl-Y clears input string but preserves current record position
- ON KEY DO keyhand
- ELSE
- ** Stuff the keyboard buffer with cursor key to move record position
- CALL keybd WITH CHR(userpress)+CHR(trapkey)
- ON KEY LABEL home DO keyhand
- ENDIF
- OTHERWISE
- ** Search for input string
- recnum = RECNO()
- DO CASE
- CASE userpress = 19 ;
- .OR. userpress = 127
- ** Backspace or Left arrow erases one character
- matchstr = SUBSTR(matchstr,1,LEN(matchstr)-1)
- newstr = matchstr
- OTHERWISE
- newstr = matchstr + CHR(userpress)
- ENDCASE
-
- SEEK UPPER(newstr)
-
- IF FOUND()
- matchstr = newstr
- DO keydisp WITH matchstr
- ************************************************************
- * In dBASE IV 1.0, Browse will not automatically reposition
- * screen UNLESS you move the cursor.
- * In dBASE IV 1.1, you do not need to do this.
- * **********************************************************
- IF db1_0 .AND. recnum # RECNO()
- CALL keybd WITH CHR(5) + CHR(trapkey) && UP/trapkey
- ON KEY LABEL home DO keyhand
- ELSE
- ON KEY DO keyhand
- ENDIF
- ELSE
- *** No Match
- ? CHR(7) && Beep
- GOTO recnum
- ON KEY DO keyhand
- ENDIF
- ENDCASE
- RETURN
-
- *!*********************************************************************
- *!
- *! Procedure: KEYDISP
- *!
- *! Called by: KEYHAND (procedure in BROWDEMO.PRG)
- *!
- *!*********************************************************************
- PROCEDURE keydisp
- PARAMETER dispstr
- ****************************************
- * Display the current input string
- ****************************************
- ACTIVATE WINDOW inwin
- CLEAR
- ? dispstr
- ACTIVATE WINDOW browwin
- RETURN
- *: EOF: BROWDEMO.PRG
- ---
- . MegaMail 2.10: Toronto Blue Jays 1992 World Series CHAMPIONS!
- --
- Canada Remote Systems - Toronto, Ontario
- World's Largest PCBOARD System - 416-629-7000/629-7044
-