FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Autosort no funciona con Object (MySql)?
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Autosort no funciona con Object (MySql)?
Posted: Thu Sep 06, 2018 06:01 PM
Amigos.
Tengo el siguiente codigo (xBrowse con TMySql) que da error al usar AUTOSORT:

Code (fw): Select all Collapse
REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  OBJECT oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ; 
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS AUTOSORT

Alguien puede darme una luz sobre esto?
Saludos.

El error es:
Application
===========
Path and name: D:\FAPSOFT\NEWCONT32_MYSQL\Wcont32.Exe (32 bits)
Size: 2,611,712 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9445)
FiveWin Version: FWHX 12.03
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 33 secs
Error occurred at: 06/09/2018, 11:53:28
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U

Stack Calls
===========
Called from: => UPPER( 0 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:SETORDER( 11450 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:HEADERLBUTTONUP( 10347 )
Called from: XBROWSE.PRG => TXBROWSE:LBUTTONUP( 3399 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
Called from: XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11793 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: D:\FAPSOFT\NEWCON~2\wcont32.prg => BROWBALANZA( 198 )
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Fri Sep 07, 2018 09:03 PM
Holas.
Si hago:
Code (fw): Select all Collapse
oBrw:bSeek := { |c| MysqlSeek( oBrw:oMysql, c ), oBrw:Refresh() }

obtengo el siguiente error:
Code (fw): Select all Collapse
Error: Unresolved external '_HB_FUN_MYSQLSEEK' referenced from D:\FAPSOFT\NEWCONT32_MYSQL\WCONT32.OBJ


MySqlSeek() // Esta function se encuentra en XBrowse.prg y es static.
Uso FW1204
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Sun Sep 09, 2018 11:13 PM
It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.

It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)
Code (fw): Select all Collapse
            cSort   := Upper( ::oBrw:oMysql:cSort )

Before defining xbrowse try setting
Code (fw): Select all Collapse
oBalanza:cSort := ""
Regards



G. N. Rao.

Hyderabad, India
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Wed Sep 12, 2018 02:14 AM
Code (fw): Select all Collapse
oBalanza:=oServer:Query(" SELECT * FROM " + cBalanza + "  WHERE saldoant<>'0' OR movdebe<>'0' OR movhaber <>'0' OR saldoact <>'0' ORDER BY codicont ;")

oBalanza: cSort: = ""

REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  OBJECT oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ; 
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS  //AUTOSORT

WITH OBJECT oBrw
    //:SetMySql(oBalanza, .f., .t., )
    :CodiCont:cSortOrder := "CODICONT"  
END
  
  oBrw:bSeek := { |c| MysqlSeek( oBalanza, c ) }    //this not works


It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.

Yes, I use it linked to my program. ( XBrowse.prg Ver 1204 )

It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)

Yes.
I followed your instructions, but the error persists. ( oBalanza: cSort: = "" or oBalanza: cSort: = "CODICONT" )

Indeed, the error occurs in the line you mention, whose value is always nil. ( cSort: = Upper (:: oBrw: oMysql: cSort) )

Thanks
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Wed Sep 12, 2018 02:37 AM

After you assigned a character value to oBalanza:cSort, how is it getting reset to NIL on its own?

Regards



G. N. Rao.

Hyderabad, India
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Wed Sep 12, 2018 04:48 PM
Mr. Rao.
This xbrowse works well with dbf files, and we have not made any modifications to the SetOrder (), Seek () methods,

Code (fw): Select all Collapse
oBalanza:=oServer:Query(" SELECT * FROM " + cBalanza + "  WHERE saldoant<>'0' OR movdebe<>'0' OR movhaber <>'0' OR saldoact <>'0' ORDER BY codicont ASC ;")

oBalanza:cSort := "CODICONT" 

  REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  DATASOURCE oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ; 
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS //AUTOSORT 

  WITH OBJECT oBrw
    //:SetMySql(oBalanza, .f., .t., )

    :CodiCont:cSortOrder := "CODICONT"   //los indices
  END

  oBrw:bSeek := { |c| MysqlSeek( oBalanza, c ) }



When you click on the header of the CODICONT column, it shows the following error.
Application
===========
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9445)
FiveWin Version: FWHX 12.03
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U

Called from: => UPPER( 0 )
Called from: D:\FAPSOFT\NEWCON~2\xbrowse.prg => TXBRWCOLUMN:SETORDER( 11453 ) //this line varies from previous post, because I have added some msginfo ().
Variables in use
================
Procedure Type Value
==========================
UPPER
Param 1: U
Local 1: U
Local 2: U
TXBRWCOLUMN:SETORDER
Local 1: O Class: TXBRWCOLUMN
Local 2: L .F.
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: U
Local 9: U
Local 10: U





When typing for incremental search, it does nothing. (Do not search)
Code (fw): Select all Collapse
METHOD SetOrder() CLASS TXBrwColumn

      elseif nAnd( ::oBrw:nDataType, DATATYPE_MYSQL ) == DATATYPE_MYSQL .and. ;
            ::oBrw:oMysql != nil
         if ::oBrw:oMysql:IsKindOf( 'TDOLPHINQRY' )
            ........
            .......
         else
            //msginfo( ::cSort , "METHOD SetOrder()")  //Here, allways show nil.
            cSort   := Upper( ::oBrw:oMysql:cSort )
            cSort   := TRIM( StrTran( StrTran( cSort, 'DESC', '' ), 'ASC', '' ) )
            if EQ( cSort, ::cSortOrder )
               .......
               .......



METHOD Seek( cSeek ) CLASS TXBrowse
.....
.....
   uBook := ::BookMark

   if !Eval( ::bSeek, cSeek )  //Here you receive .f.
      ::BookMark  := uBook
      MsgBeep()
      return lRet
   endif

   lRet     := .t.

Best regards.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Wed Sep 12, 2018 08:34 PM

Mr Rao.
Despues de muchas pruebas y haber revisado xbrowse.prg, he llegado a la conclusioón que la classe TMysql contenida en la libreria MySql.lib, que bajé del blog de Wormar, no tiene el method o propiedad oMySql:cSort.

Tampoco pude encontrar informacion sobre la function WSEEKPLUS, contenida en la function MySqlSeek().

Talvez el Sr. William puede compartir los fuentes.

Saludos.

Mr Rao.
After many tests and having reviewed xbrowse.prg, I have come to the conclusion that the TMysql class contained in the MySql.lib library, which I downloaded from the Wormar blog, does not have the method or property oMySql: cSort.

Also, I could not find information about the WSEEKPLUS function, contained in the MySqlSeek () function.

Maybe Mr. William can share the sources.

Greetings.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Wed Sep 12, 2018 08:46 PM

Estimado William Morales.
Reitero mi solicitud.
Gracias.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Autosort no funciona con Object (MySql)?
Posted: Fri Sep 14, 2018 12:54 AM

Hola.
Lo he solucionado tomando el methodo seek() de tmysql de Shuming Wang. La pasé a function y está funcionando.
Todos los créditos a Wang.
Mientras tanto, voy a tratar de crear la libreria, usando la tmysql de Wang.
Saludos.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql

Continue the discussion