Search in xBrowse

Search in xBrowse

Postby Natter » Sat Feb 04, 2017 12:30 pm

The example xbgetbar.prg does not work .And how it can work if there is no index file ?
Well, add-
INDEX ON FIRST TAG FIRST TO CTMP
INDEX ON LAST TAG LAST TO CTMP
But also in this case search works only partially - on floor LAST.
Change
110,20 XBROWSE oBrw SIZE-20,-20 PIXEL OF oDlg;
DATASOURCE "CUSTOMER" AUTOCOLS CELL LINES NOBORDER
On
110,20 XBROWSE oBrw SIZE-20,-20 PIXEL OF oDlg;
DATASOURCE "CUSTOMER" AUTOCOLS AUTOSORT CELL LINES NOBORDER
Search works!
Questions:
1) And search without AUTOSORT can work? If - Yes, as? :)
2) whether search here with such syntax Can work-
ADD oCol TO oBrw DATA Pr-> Gr HEADER "KOD" SIZE 52 CARGO " Pr-> Gr "
oCol:nHeadStrAlign: = AL_CENTER
, etc.
3) Do you want to do the search box in the footer xBrowse ?

Many thanks!
Natter
 
Posts: 1204
Joined: Mon May 14, 2007 9:49 am

Re: Search in xBrowse

Postby nageswaragunupudi » Sat Feb 04, 2017 6:17 pm

GetBar's only purpose is to provide a place for Gets in the Header bar. It is entirely for the programmer to decide (a) for what column headers he wants the Gets, (b) what should be initial values of the Gets and (c) what he wants to do with the value entered by the user in the Gets. XBrowse, by itself, does not use the values in the Gets. The programmer can decide to use the value for search or filter or for some other purpose he may decide.

What is demonstrated in the xbgetbar.prg is how a programmer can use the values entered by the user to filter the data. And this program surely does work what it is expected to do. For filtering data indexes are not required.

SEEK works only when there is an active index. That is how DBFs work.

When DBF is indexed and there is an active index and if XBrowse is created with AUTOSORT feature, the internal Incremental Seek of XBrowse works. This has NOTHING TO DO with GetBar.

1) And search without AUTOSORT can work? If - Yes, as? :)

Xbrowse's built-in internal seek works automatically if the browse is created with COLUMNS clause and AUTOSORT clause and the DBF has indexes and if any column is set to an index.
If you need a similar or a different search feature without using AUTOSORT, you need to write your own code.

2) whether search here with such syntax Can work-
ADD oCol TO oBrw DATA Pr-> Gr HEADER "KOD" SIZE 52 CARGO " Pr-> Gr "
oCol:nHeadStrAlign: = AL_CENTER
, etc.

You also need to use the clause SORT <cIndexTag/nIndexNo>
Please see xbrowse.ch for the syntax
3) Do you want to do the search box in the footer xBrowse ?

Not provided.
Regards

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

Re: Search in xBrowse

Postby Natter » Sat Feb 04, 2017 7:29 pm

Mr. Rao, thank you for Your detailed answer !
Natter
 
Posts: 1204
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wilsongamboa and 89 guests