Page 1 of 1

DC_FindBrowse

Posted: Tue Nov 22, 2011 4:49 pm
by MIGUELON
Hello Roger, when you use the DC_FindBrowse and I have enabled "lAutoSeek =. t.."
You could improve the search, if you type a character that there will not let me keep writing.

Regards
Miguel

Re: DC_FindBrowse

Posted: Tue Nov 22, 2011 5:11 pm
by rdonnay
I do not understand your question.

Re: DC_FindBrowse

Posted: Wed Nov 23, 2011 11:41 am
by MIGUELON
Try to explain better.
When I search for a string with dc_findBrowse eg "JOE" and the more value proximity table is "JOAQUIN", I wish that I only can type "JO"

Regards
Miguel

Intentare explicarme mejor.
Cuando busco una cadena de caracteres con dc_findBrowse por ejemplo "JOE" y en la tabla el valor mas proximio es "JOAQUIN", desearia que solo me permita solo escribir "JO"

Saludos
Miguel

Re: DC_FindBrowse

Posted: Wed Nov 23, 2011 12:01 pm
by rdonnay
DC_FindBrowse() is something that I regret ever writing because it doesn't always suit everyone.

I suggest that you look at DC_BrowseAutoSeek() and create your own find browse.
You can pass it a code block for how you want to handle the seek.

When seeking a database, DC_BrowseAutoSeek() and DC_FindBrowse() both do a soft-seek via dbSeek().
This usually satisfies most user requirements. You could write your own algorithm for seeking if you need something more advanced.

Re: DC_FindBrowse

Posted: Wed Nov 23, 2011 5:08 pm
by MIGUELON
Thanks for your reply Roger, I try not to modify the original code because every time a new update of eXpress + + I have to adapt to all the changes I've made.
I think it is more optimal dc_findborwse not allow me to keep looking for a fact that does not exist, so take your advice and will adapt its code.

Thank you very much
Miguel

Re: DC_FindBrowse

Posted: Thu Nov 24, 2011 6:03 am
by RDalzell
PSST-0004.jpg
PSST-0004.jpg (99.83 KiB) Viewed 11426 times
Miguel,

Attached is an example of a routine which I use, perhaps you will find it helpful.

Rick

Re: DC_FindBrowse

Posted: Thu Nov 24, 2011 2:05 pm
by MIGUELON
Thank you very much for your help Rich, always learn the "code" of a partner. :)

Regards
Miguel

Re: DC_FindBrowse

Posted: Thu Nov 24, 2011 2:13 pm
by MIGUELON
For if another user wants the search with dc_findbrowse smarter, I send the changes I made ​​in _dcfindx.prg. :)


IF Eval(bSeek,IIF( Valtype(cBuffer)="C",cPrefix + cBuffer,cBuffer))
IF (cAlias)->(DC_Eof())
(cAlias)->(DC_DbGoBottom())
ENDIF
nRecNo := (cAlias)->(RecNo())
IF oBrowse:isDerivedFrom("XbpBrowse")
oBrowse:refreshAll()
IF nRecNo # (cAlias)->(RecNo())
(cAlias)->(dbGoto(nRecNo))
oBrowse:refreshAll()
ENDIF
ELSEIF oBrowse:isDerivedFrom("XbpQuickBrowse")
oBrowse:gotoRecord((cAlias)->(RecNo()))
ENDIF
ELSE
//SIlex
PostAppEvent(xbeP_Keyboard,xbeK_BS,,oGet)
Break
ENDIF


Regards
Miguel