FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Wbrowse cell edit - problem in TGET class
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Wbrowse cell edit - problem in TGET class
Posted: 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 (fw): Select all Collapse
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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: Wed Aug 23, 2017 09: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Wbrowse cell edit - problem in TGET class
Posted: Wed Aug 23, 2017 09:36 PM

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

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Wbrowse cell edit - problem in TGET class
Posted: Wed Aug 23, 2017 09:42 PM
Anyway, the problem seems to be here in tget.prg, method Default():

Code (fw): Select all Collapse
   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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Wbrowse cell edit - problem in TGET class
Posted: 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 (fw): Select all Collapse
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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: 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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Wbrowse cell edit - problem in TGET class
Posted: Thu Aug 24, 2017 08: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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: 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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: Fri Feb 16, 2018 06: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: 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 (fw): Select all Collapse
   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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: Sat Feb 17, 2018 01: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Wbrowse cell edit - problem in TGET class
Posted: Sat Feb 17, 2018 02:00 PM

Yes
Already fixed for 18.02

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion