XBrowse and TDataRow (alias FW_Record) work with all kinds of datasources viz., dbf, tdatabase, ado (any rdbms), dolphin, tmysql, fw-mysql, postgre, eagle, etc.
This enables the application programmer to write highly portable code. He can use exactly the same code with any of these datasources.
We highly recommend not to use any of these internal methods like rddincrseek(), etc. in the application program.
Just select what we want:
- Code: Select all Expand view
// incremental seek is always on by default
// from FWH2212 onwards, we can disable this by setting oBrw:lIncrseek := .f.
oBrw:lSeekWild := .t. // wildcard search is on
oBrw:lIncrFilter := .t. // It is now filter not just seek
// If lSeekWild and lIncrFilter are both .t., this is wildcard filter
After setting these variables, there is nothing else to do.
XBrowse automatically responds to the key strokes and does the Seek or WildSeek or Filter or WildFilter as the case may be.
Please test
- Code: Select all Expand view
XBROWSER "CUSTOMER.DBF" AUTOSORT
Please first play with all options of seek
Also it is worth going through the code of function XBrowse(...) in \fwh\source\function\xbrowser.prg
Being a Windows application, INKEY() is not used, but the methods KeyDown() and KeyChar() are used ( handling WM_KEYDOWN messages)
There is not input box and when the browse has focus, xbrowse responds to the keys pressed by the user to perform the seek/filter according to the variable set as explained above.
Sampe code to display cSeek:
- Code: Select all Expand view
@ nRow, 135 SAY oBrw:oSeek prompt oBrw:cSeek ;
SIZE 100,10 PIXEL UPDATE OF oDlg ;
COLOR CLR_RED,CLR_YELLOW
When the xbrowse does incremental seek / filter, the expression entered by the user is displayed in the Say.
Though we do not recommend, the above can be a GET control also.