problem with big dbf on xbrowse

problem with big dbf on xbrowse

Postby Silvio.Falconi » Mon Jun 10, 2024 11:37 am

Image

I have a problem with an archive of 61819 records, I need it because it is the list of banks and the operator has to search for a bank to obtain the swift code, the problem is that the search is very slow, i.e. it takes more than a minute and a half and I don't understand why I set it this way in xbrowse



Code: Select all  Expand view  RUN
:lHScroll  := .f.
            :lIncrFilter      := .f.
            :bOnSort          := { |b,oCol| oBrw:Seek( "" ), ;
                                   oBrw:cFilterFld := oCol:cExpr, ;
                                   oBrw:SetFocus() }
            :oSeek := oGet
            :CreateFromCode()
         END


if I change the command :lIncrFilter := .f. in :lIncrFilter := .t. the search is faster but then if I go to print the records it also prints those that have nothing to do with the location searched for

this is the structure of the archive

Code: Select all  Expand view  RUN

local aFields := { { "ABI", "C", 5, 0 },;
                   { "CAB", "C", 5, 0 },;
                   { "ISTBAN", "C", 106, 0 },;
                   { "FILBAN", "C", 40, 0 },;
                   { "INDIR", "C", 50, 0 },;
                   { "CAP", "C", 6, 0 },;
                   { "LOCALITA", "C", 42, 0 },;
                   { "PROV", "C", 2, 0 },;
                   { "SWIFT", "C", 11, 0 } }

 


the archive is indexed in this way


Code: Select all  Expand view  RUN

         INDEX ON upper(ISTBAN)  TAG  DESC    FOR !deleted()
         INDEX ON ABI     TAG  ABI    FOR !deleted()
         INDEX ON CAB     TAG  CAB    FOR !deleted()
         INDEX ON upper(LOCALITA)    TAG  Comune    FOR !deleted()
         INDEX ON cap    TAG  Cap  FOR !deleted()
         INDEX ON upper(PROV)    TAG PROV    FOR !deleted()

 


any solution ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem with big dbf on xbrowse

Postby karinha » Mon Jun 10, 2024 3:31 pm

Silvio, question: Do you CREATE THE INDEX in real time every time you enter the program?

Silvio, pregunta: ¿CREAS EL ÍNDICE en tiempo real cada vez que ingresas al programa?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby Silvio.Falconi » Mon Jun 10, 2024 5:17 pm

karinha wrote:Silvio, question: Do you CREATE THE INDEX in real time every time you enter the program?

Silvio, pregunta: ¿CREAS EL ÍNDICE en tiempo real cada vez que ingresas al programa?

Regards, saludos.



No
I use tdatabase and the indexes made by administrator but not by user Is on lan
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem with big dbf on xbrowse

Postby karinha » Mon Jun 10, 2024 5:26 pm

Is there any problem sending this DATABASE via email so I can test it in xBrowse()?

¿Hay algún problema al enviar esta BASE DE DATOS por correo electrónico para poder probarla en xBrowse()?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby Silvio.Falconi » Tue Jun 11, 2024 8:00 am

karinha wrote:Is there any problem sending this DATABASE via email so I can test it in xBrowse()?

¿Hay algún problema al enviar esta BASE DE DATOS por correo electrónico para poder probarla en xBrowse()?

Regards, saludos.




I don't think I can do it, the archive has reserved rights and is not public, we use it because it was donated to us by a bank
you too can create an archive with the structure and insert 62 thousand records
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem with big dbf on xbrowse

Postby Antonio Linares » Wed Jun 12, 2024 6:38 pm

FWH\samples\dbcre8.prg creates a DBF with x amount of records and fills them automatically :-)

Inspired on dbcre8 from successware!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 10:33 am

Antonio Linares wrote:FWH\samples\dbcre8.prg creates a DBF with x amount of records and fills them automatically :-)

Inspired on dbcre8 from successware!


Gracias querido maestro. Comenzaré a probar y comentaré si xBrowse() fue realmente lento.

Thank you dear master. I'll start testing and comment if xBrowse() was really slow.

Gracias, tks.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 3:36 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 3:39 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 3:43 pm

Maestro Antônio, es verdad, Silvio Falconi tiene razón. La diferencia en la apertura/visualización de xBrowse() en relación con wBrowse() es de +- 1 minuto. Se convierte en un molesto reloj de arena hasta que aparece la pantalla xBrowse().

Master Antônio, it's true, Silvio Falconi is right. The difference in Opening/Display of xBrowse() in relation to wBrowse() is +- 1 minute. It becomes an annoying Hourglass until the xBrowse() display appears.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 3:45 pm

Code: Select all  Expand view  RUN

// C:\SILXBRW2\SILVSLOW.PRG - Version: 01
// INICIO     EN: 12/06/2024
// MODIFICADO EN: 13/06/2024 - POR: Joao Santos.

#Include "Ambienty.ch"  // Todos os includes aqui.

#Define aPubGrad {| lInvert | If( lInvert, ;
                 { { 1 / 3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
                 { 2 / 3, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) }    ;
                 },                                                         ;
                 { { 1 / 2, nRGB( 219, 230, 244 ), nRGB( 207 - 50, 221 - 25, 255 ) }, ;
                 { 1 / 2, nRGB( 201 - 50, 217 - 25, 255 ), nRGB( 231, 242, 255 ) }    ;
                 } ) }

REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850 // PARA INDEXAR CAMPOS ACENTUADOS

ANNOUNCE RDDSYS // IDEM: ANNOUNCE FPTCDX
REQUEST OrdKeyNo, OrdKeyCount, OrdCreate, OrdKeyGoto
REQUEST DBFCDX, DBFFPT

STATIC oWnd, oFont, nHFont, cFont, nWFont, cFontH, oFnt, oFont40
STATIC oMeter, oText, nOpcRadioEnde := 1
STATIC oFont1, oFont2, oFont3

FUNCTION Main()

   LOCAL oBmp, oIco, oSaida, oHand, oBar

   PUBLIC XRESOLUCAO

   hb_gcAll( .F. ) // PARA LIMPAR A MEMORIA .F. -> Somente se tiver lixo.

   hb_langSelect( 'PT' )     // Default language is now Portuguese
   HB_SETCODEPAGE( "PT850" )

   rddSetDefault( "DBFCDX" )
   rddRegister( "DBFCDX", 1 )

   SET CENTURY ON
   SET DATE BRITISH
   SET TIME FORMAT TO "HH:MM:SS"
   SET EPOCH TO Year( Date() ) - 30
   SET SOFTSEEK OFF
   SET WRAP ON
   SetCancel( .F. )
   SET CONFIRM OFF
   SET DELETED ON
   SET _3DLOOK ON
   SET UNIQUE OFF
   SET ESCAPE OFF
   SET EXACT ON       // CONTROLA O :=, = e ==
   SET EXCLUSIVE OFF
   SET MULTIPLE OFF
   SET OPTIMIZE ON

   cFont   := "Segoe UI Symbol"  // "Calibri"
   cFontH  := -14  // -10 //-12 //-16 //-18  //-20

   IF !IsWin8() .AND. !IsWindows10()
      cFont   := "Calibri"   // "Tahoma"
   ENDIF

   SetBalloon( .T. ) // Balloon shape required for tooltips

   SkinButtons()

   IF FILE( "AGUARDE.wav" )

      SndPlaySound( "AGUARDE.wav", 0 )

   ENDIF

   MsgRun( "ESPERE POR FAVOR... ABRIENDO BASES DE DATOS.",       ;
           "Espere hasta que se abra. Puede que tarde un poco.", ;
           { || WinExec( ABERTURA_DOS_BANCOS() ), 3 } )

   XRESOLUCAO := "R1024_768" // RESOLUTION

   DEFINE CURSOR oHand RESOURCE "Dedo"
   DEFINE ICON oIco    RESOURCE "ICONE02"  // EM IMAGENS.RES
   DEFINE FONT oFont   NAME cFont    SIZE 0, cFontH WEIGHT 300
   DEFINE FONT oFont40 NAME 'Tahoma' SIZE 0, - 40 BOLD

   DEFINE WINDOW oWnd TITLE "xBrowse Sample"                                 ;
      MENU BuildMenu() MENUINFO 3 ICON oIco MDI

   oWnd:SetFont( oFont )

   DEFINE BUTTONBAR oBar BUTTONSIZE 50, 54 _3DLOOK TOP OF oWnd 2007

   WITH OBJECT oBar

      oBar:bClrGrad := aPubGrad  // Preferi assim.

      oBar:SetFont( oFont )
      oBar:nClrText := CLR_HBLUE // BLACK
      oBar:Adjust()

   END

   DEFINE BUTTON OF oBar FILENAME ".\open.bmp" PROMPT "&Open" FLAT   ;
      ACTION( XBROWSE_SILV_SLOW() ) TOOLTIP "Abrir base de datos." GROUP

   DEFINE BUTTON OF oBar FILENAME ".\Index.bmp" PROMPT "&Index" FLAT ;
      ACTION( MsgMeter( { | oMeter, oText, oDlg, lEnd |              ;
                       CREA_INDICES( oMeter, oText, oDlg, @lEnd ) }, ;
            'Aguarde, Indexando Archivo...', 'Por Favor, Espere' ) ) ;
      TOOLTIP "Archivos de índice" GROUP

   DEFINE BUTTON OF oBar FILENAME ".\Exit.bmp" PROMPT "Exit" FLAT    ;
      ACTION( oWnd:End(), CIERRA_TODO() )                            ;
      TOOLTIP "Salir de la aplicación" GROUP

   SET MESSAGE OF oWnd TO "© João Santos - +55(11) 9.5150-7341 "     ;
      + "- joao@pleno.com.br" + " - www.pleno.com.br" FONT oFont     ;
      NOINSET CLOCK DATE KEYBOARD COLOR CLR_HBLUE, CLR_WHITE 2007

   DEFINE BITMAP oBmp FILENAME ".\sea.bmp"

   oWnd:bPainted = {| hDC | BmpTiled( hDC, oWnd, oBmp ) }

   ACTIVATE WINDOW oWnd MAXIMIZED

RETURN NIL

FUNCTION BuildMenu()

   LOCAL oMenu

   MENU oMenu 2007

      MENUITEM "Información"

      MENU
         MENUITEM "&About..."               ;
            ACTION MsgInfo( FWDESCRIPTION ) ;
            FILENAME ".\info.bmp"

      SEPARATOR
      MENUITEM "&Finaliza"                   ;
         ACTION( oWnd:End(), CIERRA_TODO() ) ;
         FILENAME ".\exit.bmp"

      ENDMENU

   ENDMENU

RETURN( oMenu )

FUNCTION ABERTURA_DOS_BANCOS()

   PUBLIC DBSILVSLOW

   IF .NOT. FILE( "SILVSLOW.CDX" )

      CLOSE DATABASES

      USE SILVSLOW NEW EXCLUSIVE ALIAS SILVSLOW

      INDEX ON Field->FIRST  TAG 01 TO SILVSLOW FOR .NOT. DELETED()

      INDEX ON Field->LAST   TAG 02 TO SILVSLOW FOR .NOT. DELETED()

      INDEX ON Field->STREET TAG 03 TO SILVSLOW FOR .NOT. DELETED()

      INDEX ON Field->CITY   TAG 04 TO SILVSLOW FOR .NOT. DELETED()

      INDEX ON Field->STATE  TAG 05 TO SILVSLOW FOR .NOT. DELETED()

      CLOSE DATABASES

   ENDIF

   USE SILVSLOW ALIAS SILVSLOW INDEX SILVSLOW NEW SHARED

   SET ORDER TO 01

   DBSILVSLOW := ALIAS() // SILVSLOW.DBF

   GO TOP

RETURN NIL

FUNCTION CREA_INDICES( oMeter, oText, oDlg, lEnd )

   FIELD FIRST, LAST, STREET, CITY, STATE, MARRIED

   LOCAL nTotal := 100

   IF FILE( "SILVSLOW.CDX" )

      AEVAL(DIRECTORY( "SILVSLOW.CDX" ),{ |aFILE| FERASE(aFILE[F_NAME]) } )

   ENDIF

   CLOSE DATABASES

   USE SILVSLOW NEW EXCLUSIVE ALIAS SILVSLOW

   oMeter:nTotal = RecCount()

   INDEX ON Field->FIRST  TAG 01 TO SILVSLOW FOR .NOT. DELETED()           ;
      EVAL ( oMeter:Set( RecNo() ), CursorWait(), SysRefresh() ) EVERY 10

   INDEX ON Field->LAST   TAG 02 TO SILVSLOW FOR .NOT. DELETED()           ;
      EVAL ( oMeter:Set( RecNo() ), CursorWait(), SysRefresh() ) EVERY 10

   INDEX ON Field->STREET TAG 03 TO SILVSLOW FOR .NOT. DELETED()           ;
      EVAL ( oMeter:Set( RecNo() ), CursorWait(), SysRefresh() ) EVERY 10

   INDEX ON Field->CITY   TAG 04 TO SILVSLOW FOR .NOT. DELETED()           ;
      EVAL ( oMeter:Set( RecNo() ), CursorWait(), SysRefresh() ) EVERY 10

   INDEX ON Field->STATE  TAG 05 TO SILVSLOW FOR .NOT. DELETED()           ;
      EVAL ( oMeter:Set( RecNo() ), CursorWait(), SysRefresh() ) EVERY 10

   CLOSE DATABASES

   ABERTURA_DOS_BANCOS()

RETURN NIL

FUNCTION XBROWSE_SILV_SLOW()

   LOCAL oDlg, oGroup1, oGroup2, oFnt, oFont, IDCor, oSaida, aGet := ARRAY(5)
   LOCAL cAlias, oIncluir, oAlterar, oExcluir, oImprimir, oLbx, oRadMenu
   LOCAL oFont1, oFont2, oFont3

   HB_GCALL( .F. )

   SELECT( DBSILVSLOW )  // SILVSLOW.DBF

   cAlias := ALIAS()

   IF( XRESOLUCAO = "R1024_768" )

      DEFINE FONT oFont  NAME "Ms Sans Serif"  SIZE 00, -14 BOLD
      DEFINE FONT oFnt   NAME "Ms Sans Serif"  SIZE 00, -12 BOLD
      DEFINE FONT oFont1 NAME "Calibri"        SIZE 0,  -14
      DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0,  -18
      DEFINE FONT oFont3 NAME "Segoe UI"       SIZE 0,  -26

   ELSEIF( XRESOLUCAO = "R1280_768" )

      DEFINE FONT oFont  NAME "Ms Sans Serif"  SIZE 00, -16 BOLD
      DEFINE FONT oFnt   NAME "Ms Sans Serif"  SIZE 00, -12 BOLD
      DEFINE FONT oFont1 NAME "Calibri"        SIZE 0,  -16
      DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0,  -20
      DEFINE FONT oFont3 NAME "Segoe UI"       SIZE 0,  -28

   ENDIF

   aGrad := { { 0.30, CLR_WHITE, CLR_WHITE },{ 0.50, CLR_WHITE, CLR_WHITE } }

   DEFINE CURSOR oCurDedo RESOURCE "Dedo"

   IF( XRESOLUCAO = "R1024_768" )

      DEFINE DIALOG oDlg RESOURCE "BROWSE_CAD_PROPOSTA_1024_768" GRADIENT aGrad

   ELSEIF( XRESOLUCAO = "R1280_768" )

      DEFINE DIALOG oDlg RESOURCE "BROWSE_CAD_PROPOSTA_1280_768" GRADIENT aGrad

   ENDIF

   oDlg:lHelpIcon := .F.

   REDEFINE RADIO oRadMenu VAR nOpcRadioEnde ID 201, 202, 203, 204, 205 OF oDlg ;
      UPDATE ON CHANGE( CAMBIAR_INDICE_SLOW( nOpcRadioEnde, cAlias, oLbx ),     ;
                        oLbx:Refresh(), oLbx:SetFocus() )

   // FIELD FIRST, LAST, STREET, CITY, STATE
   oRadMenu:aItems[1]:cTooltip := "Por FIRST"
   oRadMenu:aItems[2]:cTooltip := "Por LAST"
   oRadMenu:aItems[3]:cTooltip := "Por STREET"
   oRadMenu:aItems[4]:cTooltip := "Por CITY"
   oRadMenu:aItems[5]:cTooltip := "Por STATE"
   // oRadio:aItems[3]:Disable()  // DESABILITA O RADIO

   oRadMenu:SetFont( oFnt )

   REDEFINE SAY ID 404 OF oDlg COLORS CLR_BLACK, CLR_WHITE UPDATE FONT oFnt TRANSPARENT
   REDEFINE SAY ID 405 OF oDlg COLORS CLR_CYAN,  CLR_WHITE UPDATE FONT oFnt TRANSPARENT

   REDEFINE GROUP oGroup1 ID 501 OF oDlg COLOR CLR_ORANGE, CLR_WHITE FONT oFnt TRANSPARENT
   REDEFINE GROUP oGroup2 ID 502 OF oDlg COLOR CLR_ORANGE, CLR_WHITE FONT oFnt TRANSPARENT

   REDEFINE LISTBOX oLbx FIELDS                                              ;
            ( cAlias )->FIRST                                              , ;
            ( cAlias )->LAST                                               , ;
            ( cAlias )->STREET                                             , ;
            ( cAlias )->CITY                                               , ;
            ( cAlias )->STATE                                              , ;
            ( cAlias )->MARRIED                                            , ;
            SPACE(01)                                                        ;
            HEADERS ( OemToAnsi( "FIRST:"   ) )                            , ;
                    ( OemToAnsi( "LAST:"    ) )                            , ;
                    ( OemToAnsi( "STREET:"  ) )                            , ;
                    ( OemToAnsi( "CITY:"    ) )                            , ;
                    ( OemToAnsi( "STATE:"   ) )                            , ;
                    ( OemToAnsi( "MARRIED:" ) )                            , ;
                    ( OemToAnsi( " - "      ) )                              ;
            FIELDSIZES 150, 150, 250, 250, 90, 90, 01                        ;
            COLOR CLR_BROWN, CLR_LGREEN CURSOR oCurDedo FONT oFont UPDATE    ;
            ID 101 OF oDlg

   //-----------------------------------------------------------------------//
   oLbx:nClrBackHead  := CLR_LGREEN  // Cor do Fundo do Cabe‡alho
   oLbx:nClrText      := {|| nRGB( 165,  42,  42 ) } // Cor do Fundo do Cabe‡alho
   oLbx:nClrBackFocus := CLR_HRED    // Cor do Cursor Em Cima do Ötem
   oLbx:nClrForeFocus := CLR_AMARELO // Cor da letra da barra ativa
   oLbx:nClrForeHead  := CLR_HRED    // Cor nos Headers - Cabe‡alhos
   // Cor no Pano de Fundo da Browse() Listbox-Legal - abaixo o comando
   oLbx:nClrPane      := { || IIF( ( oLbx:cAlias )->( OrdKeyNo() ) %2 == 0, ;
                              CLR_LGREEN, CLR_LGRAY ) }
   oLbx:nColAct       := 2           // Onde o Cursor Vai Iniciar na coluna
   oLbx:nLineStyle    := 3           // Estilo das linhas nos dados da Browse
   oLbx:lCellStyle    := .T.         // Somente pinta a c‚lula em que o cursor esta no momento
   // Justifica o Cabe‡alho: .F. = Esquerda .T. = Centro  
   oLbx:aJustify := { .F., .F., .F., .F., .T., .F., .F. }
   oLbx:lMChange      := .F.         // Desabilita Mousemove - Movimentos do Mouse Congelam.
   oLbx:SetFocus()                   // Refocus on The Browse - Ativa o Foco na ListBox(Browse)
   oLbx:Refresh()                    // Estabiliza o Browse/Listbox - Refresca os Dados.
                                     // Pinta os Dados Novamente
   //-----------------------------------------------------------------------//

   REDEFINE BUTTONBMP oSaida ID 301 OF oDlg RESOURCE "154" TEXTRIGHT         ;
      ACTION ( oDlg:End() ) CANCEL

   oSaida:cTooltip := { "Click no Botão Para Sair",                          ;
                        "Saida - Exit - Cancelar ", 1, CLR_WHITE, CLR_CYAN }

   SET FONT OF oSaida    TO oFont

   ACTIVATE DIALOG oDlg ON INIT CTRLS_COLORS( oDlg )

   oFont:End()
   oFnt:End()
   oFont1:End()
   oFont2:End()
   oFont3:End()

RETURN NIL
// --Fecha o Programa Definitivamente e Libera a Memoria RAM.
FUNCTION CIERRA_TODO()

   IF File( "SILVSLOW.LOG" )
      DELETEFILE( "SILVSLOW.LOG" )
   ENDIF

   oFont:End()
   oFont40:End()

   dbCommitAll()
   dbUnlockAll()
   dbCloseAll()
   FreeResources()
   RELEASE ALL
   SysRefresh()

   hb_gcAll( .T. )

   CLEAR MEMORY

   PostQuitMessage( 0 )

   QUIT

RETURN NIL

STATIC FUNCTION BmpTiled( hDC, oWnd, oBmp )

   LOCAL nWidth := oWnd:nWidth(), nHeight := oWnd:nHeight()
   LOCAL nRow := 0, nCol := 0, n
   LOCAL nBmpWidth  := oBmp:nWidth(),  nBmpHeight := oBmp:nHeight()

   IF oBmp:hBitmap == 0
      RETURN NIL
   ENDIF

   WHILE nRow < nHeight

      SYSREFRESH()

      nCol = 0

      WHILE nCol < nWidth

         PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )

         nCol += nBmpWidth

      END

      nRow += nBmpHeight

   END

RETURN NIL

FUNCTION CAMBIAR_INDICE_SLOW( nOpcRadioEnde, cAlias, oLbx )

   LOCAL oDlg, oFont, oBrw, oSay, DBPESQ, cIndice, oSaida, nRecno, cResName
   LOCAL nKey := VK_ESCAPE, nColuna := 1, nProposta, aGrad, oBmp

   cResName := "LUPA2"

   IF nOpcRadioEnde == 5 //-> Por STATE

      DbSelectArea( cAlias )    
      SET ORDER TO 05

      cIndice := OemToAnsi( "STATE" )

      nColuna := 5

   ELSEIF nOpcRadioEnde == 4 //-> Por CITY

      DbSelectArea( cAlias )    
      SET ORDER TO 04

      cIndice := OemToAnsi( "CITY" )

      nColuna := 4

   ELSEIF nOpcRadioEnde == 3 //-> Por STREET

      DbSelectArea( cAlias )    
      SET ORDER TO 03

      cIndice := OemToAnsi( "STREET" )

      nColuna := 3

   ELSEIF nOpcRadioEnde == 2 //-> Por LAST

      DbSelectArea( cAlias )    
      SET ORDER TO 02

      cIndice := OemToAnsi( "LAST" )

      nColuna := 2

   ELSEIF nOpcRadioEnde == 1 //-> Por FIRST

      DbSelectArea( cAlias )    
      SET ORDER TO 01

      cIndice := "FIRST"

      nColuna := 1

   ENDIF

   GO TOP

   DBPESQ := ALIAS()

   // Master Rao, the "assembly" of xBrowse() is very slow.

   aGrad := { { 0.30, CLR_WHITE, CLR_WHITE },{ 0.50, CLR_WHITE, CLR_WHITE } }

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, -14

   DEFINE DIALOG oDlg SIZE 1000, 500 PIXEL FONT oFont                        ;
      TITLE "FIVEWIN:-> BUSQUEDA INCREMENTAL - Ingresa lo que deseas buscar" ;
      GRADIENT aGrad

   oDlg:lHelpIcon := .F.

   //    FIELD FIRST, LAST, STREET, CITY, STATE
   @ 30, 10 XBROWSE oBrw SIZE -10, -10 PIXEL OF oDlg                         ;
      DATASOURCE "DBPESQ" AUTOCOLS AUTOSORT CELL LINES NOBORDER              ;
      HEADERS "FIRST:", "LAST:", "STREET:", "CITY:", "STATE:"                ;
      FIELDS ( cAlias )->FIRST, ( cAlias )->LAST,  ( cAlias )->STREET,       ;
             ( cAlias )->CITY, ( cAlias )->STATE

   oBrw:cTooltip :={ "Click Para Pegar",                                     ;
                     "DADOS DO CLIENTE", 1, CLR_WHITE, CLR_HBLUE }

   oBrw:l2007      := .F.

   oBrw:nColSel := nColuna // <n>  // Mister Nages - Perfect. Cursor inicia na xBrowse()

   BrwColors( oBrw )

   WITH OBJECT oBrw

      oBrw:aCols[ 1 ]:nWidth := 60

      oBrw:lIncrFilter := .T. // Liga o Filtro incremental
      oBrw:lSeekWild   := .T. // Liga a busca incremental

      oBrw:bKeyDown    := { |nKey| If( nKey == VK_RETURN, ( oDlg:End() ), nil ) }
      oBrw:bKeyChar    := { |nKey| If( nKey == VK_ESCAPE, ( oBrw:Seek( "" ), oDlg:End() ), nil ) }

      // oBrw:bLDblClick  := { || cSeek := oBrw:aRow[ 2 ], oDlg:End() }

      oBrw:AutoFit() // Auto ajuste / ajuste automatico do xBrowse()

      :nStretchCol := STRETCHCOL_WIDEST  // Ajusta as colunas do xBrowse.

      oBrw:CreateFromCode()

   END

   @ 10, 055 SAY "Ingresa lo que deseas buscar: " SIZE 120, 10 PIXEL OF oDlg ;
      COLOR METRO_EMERALD, CLR_WHITE TRANSPARENT

   @ 10, 150 SAY oBrw:oSeek PROMPT oBrw:cSeek PICTURE "@!" UPDATE            ;
      OF oDlg PIXEL COLOR METRO_EMERALD, CLR_WHITE FONT oFont SIZE 120, 10 // BORDER

   @ 10, 270 SAY "Buscar Por: "+cIndice + " <Back> Apagar" SIZE 150, 10      ;
      PIXEL OF oDlg COLOR METRO_EMERALD, CLR_WHITE TRANSPARENT

   WITH OBJECT oBrw:oSeek
      oBrw:bLClicked := { || oDlg:End() }
   END

   @ 1.5, 5.5 SAY "<ESC>" SIZE 50, 12 PIXEL OF oDlg COLOR METRO_EMERALD, CLR_WHITE TRANSPARENT

   @ 0.5, 056 BITMAP oBmp RESOURCE cResName SIZE 50, 50 NO BORDER OF oDlg TRANSPARENT

   oBmp:cToolTip := "Pesquisa Incremental Por: " + cIndice

   @ 010, 005 BUTTONBMP oSaida PROMPT( "&Salida" ) ACTION( oDlg:End() )      ;
      RESOURCE "154" TEXTRIGHT SIZE 45, 12 PIXEL FONT oFont OF oDlg CANCEL

   oSaida:cToolTip := "Saida - Exit - Cancelar"

   ACTIVATE DIALOG oDlg CENTERED                                             ;
      ON INIT ( oBrw:cSeek(""), oBrw:SetFocus(), .F. )

   oFont:End()

   CLOSE( DBPESQ )  // CLOSE FILTER - FECHO FILTRO DA XBROWSE()

   // REABRO O BANCO PARA REFRESCAR A LISTBOX ORIGINAL E POSICIONO O CURSOR
   USE SILVSLOW ALIAS SILVSLOW INDEX SILVSLOW NEW SHARED
   SET ORDER TO 01
   GO TOP

   DBSILVSLOW := ALIAS() // SILVSLOW.DBF

   SELECT( DBSILVSLOW )

   oLbx:Refresh()

RETURN NIL
// Cores na xBrowse
static function BrwColors( oBrw, lFoot )

   local cClrBack
   DEFAULT lFoot          := .F.

   oBrw:l2007             := .F.
   oBrw:nRowHeight        := 24
   oBrw:nHeaderHeight     := 24
   oBrw:lFooter               := lFoot
   
   //oBrw:lRecordSelector     := .F.
   //oBrw:lColDividerComplete := .F.
   //oBrw:lRowDividerComplete := .F.
   
   oBrw:lFlatStyle        := .T.
   oBrw:bClrHeader        := { || { CLR_BLACK, CLR_WHITE, CLR_WHITE } } //RGB( 232, 255, 232 ), RGB( 232, 255, 232 ) }}
   oBrw:lFullGrid         := .F.
   oBrw:nRowDividerStyle  := LINESTYLE_NOLINES //DARKGRAY  //LINESTYLE_LIGHTGRAY      //
   oBrw:nColDividerStyle  := LINESTYLE_NOLINES //LIGHTGRAY // LINESTYLE_NOLINES

   oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
   oBrw:bClrStd = { || If( oBrw:KeyNo() % 2 == 0, ;
                         { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLUE ),;
                           RGB( 198, 255, 198 ) }, ;
                         { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLUE ),;
                           RGB( 232, 255, 232 ) } ) }
   oBrw:bClrSel = { || { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_WHITE ),;
                           RGB( 34, 177, 76 ) } } //RGB( 0x33, 0x66, 0xCC ) } }
   
   cClrBack = Eval( oBrw:bClrSelFocus )[ 2 ]
   oBrw:bClrSelFocus  := { || { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_WHITE ),;
                              cClrBack } }
   oBrw:SetColor( CLR_BLUE, RGB( 232, 255, 232 ) )

   oBrw:SetFont( oFont1 )

return nil
// By Giovanny Vecchi - TESTRAD.PRG aqui na minha pasta.
FUNCTION CTRLS_COLORS( f_oDlgContainer )

   LOCAL lc_aCtrls := {}, lc_iFor := 0
   LOCAL lc_aItemsRadio := {}

   lc_aCtrls := f_oDlgContainer:aControls

   FOR lc_iFor := 1 TO Len( lc_aCtrls )

      IF ValType( lc_aCtrls[lc_iFor] ) == "O"

         IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"

            aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems,                 ;
                   {|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
                   _oRadId:SetColor( METRO_EMERALD, CLR_WHITE ) } } )
                   
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

            SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )

            lc_aCtrls[lc_iFor]:SetColor( METRO_EMERALD, CLR_WHITE )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Thu Jun 13, 2024 3:48 pm

Master Antônio, please ask Master Rao to check if I made any mistakes in the module.

Maestro Antônio, pídale al Maestro Rao que verifique si cometí algún error en el módulo.

Descarga completa aquí:

Full download here:

https://mega.nz/file/INUE3CLY#l1tPpkd7ohfkAX-H__Xn-4AiyXJgerRDAFB-qpGQBvg

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby Silvio.Falconi » Thu Jun 13, 2024 5:12 pm

karinha wrote:Master Antônio, please ask Master Rao to check if I made any mistakes in the module.

Maestro Antônio, pídale al Maestro Rao que verifique si cometí algún error en el módulo.

Descarga completa aquí:

Full download here:

https://mega.nz/file/INUE3CLY#l1tPpkd7ohfkAX-H__Xn-4AiyXJgerRDAFB-qpGQBvg

Gracias, tks.

Regards, saludos.



Karinha,
can NOT USE MY NAME for your games tests , PLEASE ????????
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem with big dbf on xbrowse

Postby karinha » Fri Jun 14, 2024 12:49 pm

hahahahaha, Silvio, stop being annoying. I didn't put the name SILVIO FALCONI anywhere. I give the name that I think best suits my functions.

jajajajaja, Silvio, deja de ser molesto. No puse el nombre SILVIO FALCONI en ninguna parte. Le doy el nombre que creo que mejor se adapta a mis funciones.

Ponte técnico. Cíñete únicamente al tema del tema.

Get technical. Stick to the topic issue only.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: problem with big dbf on xbrowse

Postby karinha » Fri Jun 14, 2024 2:00 pm

New version working:

https://imgur.com/f0ZGegF

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 87 guests