Hello, dear friends.
I would like to use DC_FINDBROWSE() or any other Express function for a sensitive search. I notice that when I use DC_FINDBROW(), the search is performed using the first positions of the text or field. However, the searched character is often not at the beginning of the text. It could be in the middle, or at the end, etc.
Would it be possible to use Express or Xbase++ for a search that returns the largest number of results, regardless of the position of the searched character?
For example:
White Eagle of the North
If I type "of the" with DC_FINDBROWSE(), I don't get any results. And I would like the result to be White Eagle of the North, because "of the" is contained in the field.
I would appreciate your help.
Best regards.
Function for a sensitive search
-
- Posts: 181
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
-
- Posts: 492
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Function for a sensitive search
Hello,
you can use the DC_BrowseAutoSeek function with:
without ADS you can add a button "continue search" which only do a ACTION {|| OrdWildSeek(), oBrowse:RefreshAll()}
you can use the DC_BrowseAutoSeek function with:
Code: Select all
without ADS: bSeekBlock := {|a| ordwildseek("*"+alltrim(upper(a))+"*"), DC_GetRefresh(oBtWs), .T.}
with ADS: bSeekBlock := {|a| cfilter := "{|| contains(<your dbf fieldname>,'*"+a+"*'),'*"+a+"*')}", bfilter := &cfilter, ;
(sel)->(DbSetFilter(bfilter)), (sel)->(DbGoTop()), DC_GetRefresh(oBtWs), .T.}
@1,20 DCSAY "Suche:" GET Suchstr PICTURE "@K !!!!!!!!!!!!" ;
KEYBLOCK {|a, b, o| DC_BrowseAutoSeek(a, o, oBrowse, , , , , 0.01, bSeekBlock, , .T.)} ;
TABSTOP ;
GETOBJECT oSuch ;
GETID "IDSUCH" ;
SAYRIGHT
@2.5, 1 DCBROWSE oBrowse SIZE 40, 20 ;
DATA cAlias ;
.......
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Function for a sensitive search
I recommend looking at \exp20\samples\browsequery\browsequery.prg.
This uses wildcards and DC_SetScopeArray().
This uses wildcards and DC_SetScopeArray().
The eXpress train is coming - and it has more cars.
-
- Posts: 181
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
Re: Function for a sensitive search
Hello, Wolfgang Ciriack, rdonnay,
Very interesting.
Thank you.
Very interesting.
Thank you.