Jose,
Here is the problem; the last character typed into the get is getting added to the search string twice so you see:
DD
DII
DISS
DISKK
etc.
Here is how you can test it. Add a msgInfo() as shown:
- Code: Select all Expand view
STATIC FUNCTION Busqueda( oGetBusca, cKey, oDlg, oLbx, XNOMEC )
//ogetbusca el objeto get, xnomec la variable del get
LOCAL RetornaBusca := ""
MEMVAR oNome_Busca
BusquedaInterna( oGetBusca, cKey, oDlg, @RetornaBusca, oLbx )
msgInfo( retornaBusca ) // Add this line
IF lOpcaoRadio=1 //-> Busqueda de opcion uno en Radio Button
PRODUCTO->( DBSEEK( ALLTRIM( RetornaBusca), .t. ) )
ELSE //-> Busqueda de Opcion 2 do Radio Button
PRODUCTO->( ORDWILDSEEK( "*" + ALLTRIM( RetornaBusca ) + "*", .F. ) )
ENDIF
oLbx:Refresh()
RETURN( .T. )
There were changes to the way oGet:bChange is processed which probably explains what is happening. Users were complaining that bChange didn't contain the last character typed so TGet was modified so that it did. And you are adding the last character, thus you now have the last character twice.
I suggest using
oGet:bPostKey instead of oGet:bChange. bPostKey will contain the last character typed, and I have made a recommendation to Antonio to switch bChange back to its original processing as it is needed to reject invalid characters. Thus if you modify your code to work with bChange now, it will be broken again when Antonio changes the code back to its original form. You can search the forum for this discussion which was about two to three weeks ago.
I hope I have explained this well.
Regards,
James