FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error with xbincflt.prg
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Error with xbincflt.prg
Posted: Tue Jun 09, 2015 04:43 PM


Mr. Nages I insert on my dialog all your command of xbincflt.prg

I have different array of fields and headers


I have error when I change the first combo

I not understood where is the error

I made

Code (fw): Select all Collapse
static aFlds,aHdrs

function Clientes()



   oApp():oGrid := TXBrowse():New( oApp():oDlg )
   oApp():oGrid:nTop    := 16
   oApp():oGrid:nLeft   := nSplit+2
   oApp():oGrid:nBottom := oApp():oDlg:nGridBottom
   oApp():oGrid:nRight  := oApp():oDlg:nGridRight


 aBrowse   := { { { || " "}, ' ', 15 },;
                  { { || CL->CLCODICE}, i18n("Codice"), 50 },;
                  { { || CL->CLNOME }, i18n("Ragione Sociale"), 90 },;
                  { { || CL->CLINDIR }, i18n("Indirizzo"), 90 },;
                  { { || CL->CLCAP }, i18n("Cap"), 45 },;
                  { { || CL->CLCITTA }, i18n("Località"), 100 },;
                  { { || CL->CLPROV }, i18n("Provincia"), 20 },;
                  { { || CL->CLREGIONE }, i18n("Regione"), 80 },;
                  { { || CL->CLNAZIONE }, i18n("Nazione"), 80 },;
                  { { || CL->CLPARTIVA }, i18n("Partita Iva"), 60 }      }


 FOR i := 1 TO Len(aBrowse)
      oCol := oApp():oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]

   NEXT

   aHdrs :={}
   aFlds :={}
   aFlds :=  {CLCODICE,CLNOME,CLINDIR,CLCAP,CLCITTA,CLPROV,CLREGIONE,CLNAZIONE,CLPARTIVA}
    aHdrs := {     i18n("Codice")          ,;
                               i18n("Ragione Sociale") ,;
                               i18n("Indirizzo")       ,;
                               i18n("Cap")             ,;
                               i18n("Località")        ,;
                               i18n("Provincia")       ,;
                               i18n("Regione")         ,;
                               i18n("Nazione")         ,;
                               i18n("Partita Iva")      }



      oApp():oGrid:lIncrFilter   := .t.
      oApp():oGrid:lSeekWild     := ( nWild == 2 )
      oApp():oGrid:cFilterFld    := "CLCODICE"


   oApp():oGrid:SetRDD()
   oApp():oGrid:CreateFromCode()















 @ 7.1, 410 COMBOBOX oApp:oGrid:cFilterFld ;
      ITEMS aHdrs ;
      ON CHANGE (oApp:oGrid:Seek( "" ), oApp:oGrid:SetFocus() ) ;
      SIZE 100,400 PIXEL OF oApp():oTitle


// starting with  / containing ...


   @ 7.1, 570 COMBOBOX nWild ITEMS { "Voci che iniziano con..", "Voci che contengono...." } ;
      ON CHANGE ( oApp:oGrid:lSeekWild := ( nWild == 2 ), ;
                  oApp:oGrid:Seek( If( oApp:oGrid:lSeekWild, oApp:oGrid:cSeek, "" ) ), ;
                  oApp:oGrid:SetFocus() ) ;
      SIZE 120,400 PIXEL OF oApp():oTitle


     @ 7.2,700 say oApp:oGrid:oSeek PROMPT oApp:oGrid:cSeek SIZE 200,20 PIXEL ;
         OF oApp():oTitle COLOR CLR_BLACK,CLR_YELLOW PICTURE '@!'





if select the second item ---> Ragione Sociale

this error
Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\Prg\Default\Invoice.Exe (32 bits)
   Size: 4,465,664 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20140725)
   FiveWin  Version: FWHX 15.01
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 10 secs 
   Error occurred at: 09-06-2015, 18:30:07
   Error description: Error BASE/1449  Errore sintattico: &
   Args:
     [   1] = C   Ragione Sociale

Stack Calls
===========
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RDDINCRFILTER( 5175 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RDDINCRSEEK( 5119 )
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETRDD( 4147 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SEEK( 6496 )
   Called from: source\PClientes.prg => (b)CERCA_CLIENTE( 428 )
   Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:CHANGE( 420 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1702 )
   Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:HANDLEEVENT( 737 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
   Called from:  => SENDMESSAGE( 0 )
   Called from: .\source\classes\WINDOW.PRG => TC5STBAR:COMMAND( 1213 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1733 )
   Called from: Lib\C5Stbar\source\c5stbar.prg => TC5STBAR:HANDLEEVENT( 911 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1152 )
   Called from: source\Main.prg => TAPPLICATION:ACTIVATE( 397 )
   Called from: source\Main.prg => MAIN( 58 )


another sample


----if select the five item

{ { || CL->CLCITTA }, i18n("Località"), 100 },;

Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\Prg\Default\Invoice.Exe (32 bits)
   Size: 4,470,272 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20140725)
   FiveWin  Version: FWHX 15.01
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 9 secs 
   Error occurred at: 09-06-2015, 18:21:23
   Error description: Error BASE/1003  Variabile inesistente: LOCALITà

Stack Calls
===========
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RDDINCRFILTER( 5175 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:RDDINCRSEEK( 5119 )
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETRDD( 4147 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SEEK( 6496 )
   Called from: source\PClientes.prg => (b)CERCA_CLIENTE( 428 )
   Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:CHANGE( 420 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1702 )
   Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:HANDLEEVENT( 737 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
   Called from:  => SENDMESSAGE( 0 )
   Called from: .\source\classes\WINDOW.PRG => TC5STBAR:COMMAND( 1213 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1733 )
   Called from: Lib\C5Stbar\source\c5stbar.prg => TC5STBAR:HANDLEEVENT( 911 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1152 )
   Called from: source\Main.prg => TAPPLICATION:ACTIVATE( 397 )
   Called from: source\Main.prg => MAIN( 58 )

it make this error
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Error with xbincflt.prg
Posted: Tue Jun 09, 2015 05:19 PM

Perhaps I understood why it make error

resolved !!!!

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Error tecnical with xbincflt.prg
Posted: Wed Jun 10, 2015 02:21 PM
I not resolve the problem
I made a test and this problem is also on the test

the problem I use the different headers and if the user not show one columns then it cannot refresh the first combobox where there are the name of columns

I insert a buttonbar on dialog where I put the combobox

I wish read from oGRid the fields and the headers because it the user change the state ( hide a column)

I wish use

// to calc the fields and the headers
aFlds :=array( nLen )
aHdrs:= array( nLen )

FOR n = 1 TO nLen
aFlds [ n ]:= oGrid:aCols[ n ]:cExpr
aHdrs [ n ]:= oGrid:aCols[ n ]:cHeader
NEXT


instead of

cList := "FIRST,LAST,STREET,STATE"
aFlds := HB_ATokens( cList, ',' )
aHdrs := { i18n("Cognome") ,;
i18n("Nome") ,;
i18n("Indirizzo") ,;
i18n("Stato") }


these commands not run ok because all come call on clausole ON INIT of the dialog



How I can resolve it ?

this the test


Code (fw): Select all Collapse
#include "fivewin.ch"
#include "xBrowse.ch"

#define  LIGHTCYAN    nRGB( 203, 225, 252 )


REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO


static oTitle
static aFlds,aHdrs,nWild

function Main()
   local oDlg, oGrid, oFont
   local nOrder:= 1
    local nRecno:= 1

   RddSetDefault( "DBFCDX" )
   SetHandleCount( 100 )


   USE CUSTOMER ALIAS CL
   INDEX ON CL->FIRST  TAG FIRST TO CUSTOMER

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -12

     nWild := 2

 aBrowse   := {   { { || CL->FIRST}, i18n("Cognome"), 150 },;
                  { { || CL->LAST }, i18n("Nome"), 100 },;
                  { { || CL->STREET }, i18n("Indirizzo"), 190 },;
                  { { || CL->STATE}, i18n("Stato"), 145 } }





   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont TITLE 'Test '


   oGrid := TXBrowse():New( oDlg )
   oGrid:nTop    := 30
   oGrid:nLeft   := 2
   oGrid:nBottom := 200
   oGrid:nRight  := 320



  FOR i := 1 TO Len(aBrowse)
      oCol := oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]

   NEXT



oGrid:lIncrFilter   := .t.
oGrid:lSeekWild     := ( nWild == 2 )
oGrid:cFilterFld    := "FIRST"


oGrid:SetRDD()
oGrid:CreateFromCode()



  CL->(DbSetOrder(nOrder))

   if nRecNo < CL->(LastRec()) .AND. nRecno != 0
      CL->(DbGoTo(nRecno))
   else
      CL->(DbGoTop())
   endif





ACTIVATE DIALOG oDlg CENTERED ;
          ON INIT( Create_bar(oDlg), Cerca_cliente(oTitle,"CL",oGrid) )

return nil
//----------------------------------------------------------------------------------------//
Function Create_bar(oDlg)
    DEFINE BUTTONBAR oTitle _3D SIZE 44, 46 OF oDlg
return nil
//----------------------------------------------------------------------------------------//


Function Cerca_cliente(oTitle,cdbf,oGrid)
   Local nLen := Len( oGrid:aCols )
   Local n
   Local oCbx
   Local cCampo := oGrid:cFilterFld

   /*
    aFlds :=array( nLen )
    aHdrs:= array( nLen )

        FOR n = 2 TO nLen
           aFlds   [ n ]:= oGrid:aCols[ n ]:cExpr
           aHdrs   [ n ]:= oGrid:aCols[ n ]:cHeader
        NEXT

     */

     nWild := 2
       cList := "FIRST,LAST,STREET,STATE"
       aFlds :=  HB_ATokens( cList, ',' )
       aHdrs := {              i18n("Cognome") ,;
                               i18n("Nome")       ,;
                               i18n("Indirizzo")             ,;
                               i18n("Stato")      }




    @ 6.9, 10 COMBOBOX oCbx VAR  cCampo  ;
      ITEMS  aHdrs ;
      ON CHANGE (oGrid:cFilterFld :=aFlds[ocbx:nat],  oGrid:Seek( "" ), oGrid:SetFocus() ) ;
      SIZE 150,400 PIXEL OF oTitle




   @ 6.9, 190 COMBOBOX nWild ITEMS { "Voci che iniziano con..", "Voci che contengono...." } ;
      ON CHANGE ( oGrid:lSeekWild := ( nWild == 2 ), ;
                  oGrid:Seek( If( oGrid:lSeekWild, oGrid:cSeek, "" ) ), ;
                  oGrid:SetFocus() ) ;
      SIZE 150,400 PIXEL OF oTitle

     @ 6.9,340 say oGrid:oSeek PROMPT oGrid:cSeek SIZE 180,20 PIXEL ;
         OF oTitle COLOR CLR_BLACK,CLR_WHITE PICTURE '@!' BORDER


return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion