Wbrowse cell edit - problem in TGET class

Wbrowse cell edit - problem in TGET class

Postby driessen » Tue Aug 22, 2017 12:57 pm

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  RUN
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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby driessen » Wed Aug 23, 2017 9:20 pm

Hello,

Is there anyone who has an answer to my question?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby Enrico Maria Giordano » Wed Aug 23, 2017 9:36 pm

As always, we need a sample of the problem that can be compiled and run here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Wbrowse cell edit - problem in TGET class

Postby Enrico Maria Giordano » Wed Aug 23, 2017 9:42 pm

Anyway, the problem seems to be here in tget.prg, method Default():

Code: Select all  Expand view  RUN
  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
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Wbrowse cell edit - problem in TGET class

Postby cnavarro » Wed Aug 23, 2017 10:35 pm

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  RUN


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

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Wbrowse cell edit - problem in TGET class

Postby driessen » Wed Aug 23, 2017 10:39 pm

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby cnavarro » Thu Aug 24, 2017 8:37 pm

Michel, have you tried it?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Wbrowse cell edit - problem in TGET class

Postby driessen » Fri Aug 25, 2017 11:24 am

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby driessen » Fri Feb 16, 2018 6:57 pm

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby nageswaragunupudi » Sat Feb 17, 2018 11:03 am

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  RUN
  if ValType( nClrFore ) == 'B'
      ::bColor    := nClrFore
      nClrFore    := GetSysColor( COLOR_WINDOWTEXT )
   endif
 

at lines 299 to 302 and also at 488 to 491
Regards

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

Re: Wbrowse cell edit - problem in TGET class

Postby driessen » Sat Feb 17, 2018 1:59 pm

Mr. Rao,

Thanks a lot for your help. It works.

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

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Wbrowse cell edit - problem in TGET class

Postby nageswaragunupudi » Sat Feb 17, 2018 2:00 pm

Yes
Already fixed for 18.02
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], SantaCroya and 47 guests