Error in xbrowse May 2017

Error in xbrowse May 2017

Postby Maurizio » Wed Jun 07, 2017 2:11 pm

Hello Rao ,

in April 2017 this sample works .
The problem is :cEditPicture := "999999" when there are no records .

Code: Select all  Expand view

#include "fivewin.ch"
static oCn
function Main()
   local oDlg, oFont, oBrw
   local oStates, oCust
   FW_SetUnicode( .f. )
   if ( oCn := FW_DemoDB() ) == nil
      return nil
   endif

   //oStates   := oCn:RowSet( "states" ) // Create Parent
   oStates   := oCn:RowSet( "select * from states wher id = -1" ) // Create Parent
   
   XBROWSE(oStates)
   
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 900,600 PIXEL TRUEPIXEL ;
      FONT oFont ;
      TITLE "FWH MYSQL PARENT CHILD ROWSET"

   @ 20,20 XBROWSE oBrw SIZE 250,-20 PIXEL OF oDlg ;
      DATASOURCE oStates ;
      COLUMNS "Code" ; //, "Name" ;
      COLSIZES nil  ; // , 50 ;
      CELL LINES NOBORDER
     
    WITH OBJECT oBrw:InsCol(1)
       :cHeader       := "id"
       :bEditValue := { || oStates:Fields( "ID" ):Value    }
       //:cEditPicture  := "@ZE 999999.999"
       :cEditPicture  := "999999"
       
    END  
   WITH OBJECT oBrw
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   ocn:close()
   RETURN NIL

return nil


Regards Maurizio
www.nipeservice.com
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: Error in xbrowse May 2017

Postby nageswaragunupudi » Wed Jun 07, 2017 7:30 pm

What error you are getting?
I tried and did not get any error.

BTW hope you know you can also write oStates:ID instead of oStates:Fields( "id" ):Value
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error in xbrowse May 2017

Postby Maurizio » Thu Jun 08, 2017 6:42 am

Rao
I Have this error
Application
===========
Path and name: C:\FWH_16\samples\MARIA_01.exe (32 bits)
Size: 3,933,696 bytes
Compiler version: Harbour 3.2.0dev (r1703231115)
FiveWin version: FWH 17.05
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 3 secs
Error occurred at: 06/08/17, 08:40:11
Error description: Error BASE/1106 Argument error: REPLICATE
Args:
[ 1] = C B
[ 2] = U

Stack Calls
===========
Called from: => REPLICATE( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:DATATEXTWIDTH( 11594 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:DATAWIDTH( 11516 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:ADJUST( 10969 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST( 1331 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE( 1184 )
Called from: => __OBJSENDMSG( 0 )
Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 655 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 906 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: maria_01.prg => MAIN( 48 )

Maurizio
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: Error in xbrowse May 2017

Postby nageswaragunupudi » Thu Jun 08, 2017 1:53 pm

I noticed this bug recently. But this should not affect your program when the field is numeric. It affects when the inserted expression is character type and picture clause is provided.

This is fixed for 17.06.

You may please apply this fix.
Please locate the following code in
METHOD DataTextWidth( lCurrent ) CLASS TXBrwColumn
Code: Select all  Expand view

   if !Empty( ::cEditPicture ) .and. cType $ "CN+"
      lUser    := .t.
   endif
 

Please modify the first line of the above code as below
Code: Select all  Expand view

   if !Empty( ::cEditPicture ) .and. cType $ "N+" // <-- here
      lUser    := .t.
   endif
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error in xbrowse May 2017

Postby Maurizio » Thu Jun 08, 2017 2:27 pm

Thanks Rao :D

--- BTW hope you know you can also write oStates:ID instead of oStates:Fields( "id" ):Value
It's possible use with ADO ? ( In my programma I use ADO :( )

Maurizoi
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: Error in xbrowse May 2017

Postby nageswaragunupudi » Thu Jun 08, 2017 2:46 pm

No. Not possible with ADO RecordSet object.

I thought you are using FWMARIADB.

ADO syntax works both with ADO and FWMARIADB.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 9 guests