Page 1 of 1

Wbrowse cell edit - problem in TGET class

PostPosted: Tue Aug 22, 2017 12:57 pm
by driessen
Hello,

In a Wbrowse, I use dblclick on a cell to edit the value of the cell.

If the dblclick in a cell is done, this code is executed :
Code: Select all  Expand view
IF nCol != NIL
   nColGet := AScan(BetLbx:GetColSizes(),{|nColumn|nColPos += nColumn,nCol <= nColPos },BetLbx:nColPos)
ENDIF

IF nColGet = 0
   nColGet := BetLbx:nColPos
ENDIF

xVar := TabFact[nRec,12]

BetLbx:lEditCol(nColGet,@xVar,"9999999999" + IF(PAR->STDEC<>0,"."+REPLICATE("9",PAR->STDEC),""))
BetLbx:DrawSelect() 
Until FWH 17.04 this code was working just fine.
But starting FWH 17.05 i got an error.

I tried to find out where this error is happening:
Application
===========
Path and name: C:\JUDA\JUDA_2.EXE (32 bits)
Size: 9,775,616 bytes
Compiler version: Harbour 3.2.0dev (r1703231115)
FiveWin version: FWH 17.07
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 19 secs
Error occurred at: 22/08/2017, 14:55:32
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = N 0
[ 2] = N 1

Stack Calls
===========
Called from: .\source\classes\TGET.PRG => TGET:DEFAULT( 1045 )
Called from: .\source\classes\TGET.PRG => TGET:INITIATE( 819 )
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: .\Z-WBROWS.PRG => TWBROWSE:LEDITCOL( 882 )
Called from: .\BEHBOEK2.PRG => BETBROWSE( 2841 )
Called from: .\BEHBOEK2.PRG => (b)AFPBETAL( 2373 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LDBLCLICK( 1997 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:LDBLCLICK( 1744 )
Called from: .\Z-WBROWS.PRG => TWBROWSE:LDBLCLICK( 1122 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
Called from: .\Z-WBROWS.PRG => TWBROWSE:HANDLEEVENT( 1661 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: .\BEHBOEK2.PRG => AFPBETAL( 2419 )
Called from: .\BEHBOEK2.PRG => (b)DETB2( 4439 )
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1685 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 424 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 922 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: .\BEHBOEK2.PRG => DETB2( 4452 )
Called from: .\BEHBOEK1.PRG => BOEKEDIT( 2611 )
Called from: .\BEHBOEK1.PRG => (b)TOONFIN( 2438 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LDBLCLICK( 1997 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:LDBLCLICK( 1744 )
Called from: .\Z-WBROWS.PRG => TWBROWSE:LDBLCLICK( 1122 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
Called from: .\Z-WBROWS.PRG => TWBROWSE:HANDLEEVENT( 1661 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: .\BEHBOEK1.PRG => TOONFIN( 2508 )
Called from: .\FGEGTL2.PRG => (b)BUILDBAR1( 3361 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 684 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 924 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1873 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1037 )
Called from: .\JUDA.PRG => MAIN( 1051 )
The problem occurs in the TGET class.

If I ingetrate the TGET class from FWH 17.04 in my application, build with FWH 17.07, everything just runs f!ne.

Anyone any idea ?

Thanks you very much in advance.

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Wed Aug 23, 2017 9:20 pm
by driessen
Hello,

Is there anyone who has an answer to my question?

Thanks.

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Wed Aug 23, 2017 9:36 pm
by Enrico Maria Giordano
As always, we need a sample of the problem that can be compiled and run here.

EMG

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Wed Aug 23, 2017 9:42 pm
by Enrico Maria Giordano
Anyway, the problem seems to be here in tget.prg, method Default():

Code: Select all  Expand view
  if ::bColor != nil
      tmp   := Eval( ::bColor, Self )
      ::SetColor( tmp[ 1 ], tmp[ 2 ] )
   endif


If I'm not wrong, ::bColor is not always a codeblock that evaluates to a two elements array.

EMG

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Wed Aug 23, 2017 10:35 pm
by cnavarro
Michel,
To try not to modify the class while your problem is being reviewed by Mr Rao, try the following

Code: Select all  Expand view


TGet():bColorBlock   := { | o | { CLR_BLUE, CLR_WHITE } }   // your colors
BetLbx:lEditCol(nColGet,@xVar,"9999999999" + IF(PAR->STDEC<>0,"."+REPLICATE("9",PAR->STDEC),""))
TGet():bColorBlock   := nil

 

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Wed Aug 23, 2017 10:39 pm
by driessen
Enrico,

Thanks for your reply.

It is very difficult to make an executable example of the problem because it a part of very huge application.

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Thu Aug 24, 2017 8:37 pm
by cnavarro
Michel, have you tried it?

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Fri Aug 25, 2017 11:24 am
by driessen
Hello Cristobal,

Thanks a lot for trying to help me.

I tested your suggestion but unfortunately I got the same error.

Sorry that I didn't react earlier, but I was out for 2 days.

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Fri Feb 16, 2018 6:57 pm
by driessen
I did some more testing about this problem.

I noticed that the problem happens when elements of the array TMP in the TGET class is used. A bound array error occurs.

Can someone check the formation of the TMP array in the TGET class?

Thanks a lot in advance.

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Sat Feb 17, 2018 11:03 am
by nageswaragunupudi
Please make these modifications in tget.prg:
The line numbers I have given here correspond to FWH 17.07

Please remove or comment out the code
Code: Select all  Expand view
  if ValType( nClrFore ) == 'B'
      ::bColor    := nClrFore
      nClrFore    := GetSysColor( COLOR_WINDOWTEXT )
   endif
 

at lines 299 to 302 and also at 488 to 491

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Sat Feb 17, 2018 1:59 pm
by driessen
Mr. Rao,

Thanks a lot for your help. It works.

Can these problem be solved permanently in FWH 18.02 or later?

Re: Wbrowse cell edit - problem in TGET class

PostPosted: Sat Feb 17, 2018 2:00 pm
by nageswaragunupudi
Yes
Already fixed for 18.02