Hello friends
I have 2 functions that I used for incremental letter-by-letter search with DBF that I adapted for MariaDB.
In this case, the first first part where I search letter-by-letter is working perfectly, but when I try to go to the next record using the same search string it doesn't work.
Here I do the research in a GET
Button that sends to the next record
Search and next functions
I have 2 functions that I used for incremental letter-by-letter search with DBF that I adapted for MariaDB.
In this case, the first first part where I search letter-by-letter is working perfectly, but when I try to go to the next record using the same search string it doesn't work.
oRs := oServer:RowSet( "SELECT nome,r_social FROM agenda ORDER BY r_social" )Â Â Â Â @ 0069,0000 XBROWSE oBrwAGENDA OF oDlgAGENDA SIZE 0520,0230 STYLE FLAT PIXEL NOBORDER DATASOURCE oRS//AUTOSORTÂ Â
      Â
    ADD TO oBrwAGENDA DATA oRs:r_social PICTURE "@!" HEADER "Razão Social" WIDTH 520
    ADD TO oBrwAGENDA DATA oRs:nome   PICTURE "@!" HEADER "Nome"     WIDTH 520        Â
    oBrwAGENDA:nColDividerStyle := 0     Â
    oBrwAGENDA:nRowDividerStyle := 0     Â
    oBrwAGENDA:nMarqueeStyle   := 5
    oBrwAGENDA:lHScroll     := .F.
    oBrwAGENDA:lVScroll     := .T.
    oBrwAGENDA:lRecordSelector  := .F.
    oBrwAGENDA:bKeyChar     := {|nKey|IIF(nKey==VK_RETURN,((OPERACAO_AGENDA(2))),)}
    oBrwAGENDA:bClrSelFocus    := {||{nRGB(000,000,000),nRGB(150,150,150)}}
    oBrwAGENDA:bClrSel       := {||{nRGB(000,000,000),nRGB(150,150,150)}}
    oBrwAGENDA:bClrStd       := {||{CLR_BLUE,IIF(oRS:KeyNo() %2==0,CLR_WHITE,nRGB(232,232,232))}}
    oBrwAGENDA:nHeaderHeight   := 40
    oBrwAGENDA:bClrHeader    := {||{nRGB(000,000,000),nRGB(150,150,150)}}
    oBrwAGENDA:bSeek       := {|c|.F.}
     Â
    oBrwAGENDA:aCols[1]:oHeaderFont := ARIAL16B
    oBrwAGENDA:aCols[1]:bLClickHeader := {|r,c,f,o| nil}
    oBrwAGENDA:aCols[2]:oHeaderFont := ARIAL16B Â
   Â
    oBrwAGENDA:CreateFromCode()Here I do the research in a GET
@ 0045,0560 GET oGetPESQUISA VAR cPESQUISA PICTURE "@!" SIZE 0455,0020 PIXEL FONT ARIAL14B OF oBarAGENDA ON CHANGE(PESQUISA(oGetPESQUISA,oBrwAGENDA,oRS))Button that sends to the next record
@ 0045,1018 BTNBMP oBtnPROXIMO RESOURCE "BTN_PROXIMO" OF oBarAGENDA SIZE 0020,0020 PIXEL FLAT NOBORDER ACTION PROXIMO(cPESQUISA,oBrwAGENDA,oRS)Search and next functions
********************************************************************************
STATIC FUNCTION PESQUISA(_oGetPesquisa,_oBrwPESQUISA,_oRS)
********************************************************************************
  LOCAL cCHAVEPESQUISA := ""
  cCHAVEPESQUISA:=(_oGetPesquisa:oGet:Buffer)
 Â
  _oRS:ORDWILDSEEK("*"+ALLTRIM(cCHAVEPESQUISA)+"*",.F.)
  _oBrwPESQUISA:REFRESH()  Â
RETURN NIL********************************************************************************
STATIC FUNCTION PROXIMO(cPESQUISA,_oBrwPESQUISA,_oRS)
********************************************************************************
  _oRS:ORDWILDSEEK("*"+ALLTRIM(cPESQUISA)+"*",.F.)
 Â
  IF _oRS:EOF()
    _oRS:DBGOTOP()
  ENDIF
 Â
  _oBrwPESQUISA:REFRESH()  Â
                          Â
RETURN NILChristiano Augusto Silveira
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
