XBROWSE : Seek(), OrdwildSeek() and "increment"

XBROWSE : Seek(), OrdwildSeek() and "increment"

Postby Jimmy » Fri May 05, 2023 7:37 am

hi,

how does XBROWSE "increment" Seek work ... i find no Sample for DBF
does it have a "own" GET or does it use INKEY() or do i have to write my "own" Input-Box :?:

---

i saw OrdWildSeek() using ::lSeekWild in METHOD RddIncrSeek()
should i use
Code: Select all  Expand view
  METHOD RddIncrSeek( cseek, uSeek )

instead of
Code: Select all  Expand view
  METHOD Seek( cSeek )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE : Seek(), OrdwildSeek() and "increment"

Postby nageswaragunupudi » Sat May 06, 2023 12:26 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE : Seek(), OrdwildSeek() and "increment"

Postby Jimmy » Mon May 08, 2023 12:22 pm

hi

thx for Anwser

i´m still a Newbie and it is hard to learn when have no Documentation or Sample CODE

what do you think to declare Method as "PROTECT" if User should not use a Method "direct<"
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE : Seek(), OrdwildSeek() and "increment"

Postby nageswaragunupudi » Mon May 08, 2023 1:57 pm

Good idea. We will try to protect some more methods/datas.
Still we can not do it for all because some methods/datas are used both by the browse object and column object.

There are lots of examples of xbrowse in the forums and lastly we are always here to support you in every way.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests