FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse setget
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
XBrowse setget
Posted: Thu Nov 07, 2019 10:29 AM

Hi,

I'd like to know if it's possible to trigger an action when a setget field is changed in a XBrowse.

Tks

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBrowse setget
Posted: Thu Nov 07, 2019 02:00 PM
This codeblock is called after a cell is edited and saved.
Code (fw): Select all Collapse
oCol:bOnSave( oCol, uOldValue )


In case of DBF, the record is locked, new value is saved, the codeblock bOnSave is evaluated and then the record is unlocked.
Regards



G. N. Rao.

Hyderabad, India
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: XBrowse setget
Posted: Thu Nov 07, 2019 02:09 PM

Thanks for the answer. I'll see what I can achieve with it.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: XBrowse setget
Posted: Fri Nov 08, 2019 01:40 PM

I tried the following:

oBrw1:aCols[ 4 ]:SetCheck( ) // works OK

When I add the folowing line the system crashes while opening the browse.

oBrw1:aCols[ 4 ]:bOnSave := { || msgInfo( "Hi" ) }

The error log is:
Application Internal Error - D:\xProjetos\VavAta\VAVATA.EXE
Terminated at: 2019-11-08 10:23:31
Erro irrecuper vel 9003: Muitas chamadas recursivas ao manipulador de erros
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from _CLSSETERROR(247) in .\source\function\HARBOUR.PRG
Called from TXBRWCOLUMN:_BONSAVE(15912) in .\source\classes\XBROWSE.PRG
Called from DIGITAENC(421) in .\SOURCES\VAV_ENC.PRG
Called from (b)DGTENCALHE(386) in .\SOURCES\VAV_ENC.PRG
Called from TBUTTON:CLICK(179) in .\source\classes\BUTTON.PRG
Called from TBUTTON:HANDLEEVENT(1755) in .\source\classes\CONTROL.PRG
Called from _FWH(3513) in .\source\classes\WINDOW.PRG
Called from SENDMESSAGE(0)
Called from TDIALOG:COMMAND(433) in .\source\classes\DIALOG.PRG
Called from TWINDOW:HANDLEEVENT(0)
Called from TDIALOG:HANDLEEVENT(1136) in .\source\classes\DIALOG.PRG
Called from DIALOGBOX(0)
Called from TDIALOG:ACTIVATE(304) in .\source\classes\DIALOG.PRG
Called from DGTENCALHE(389) in .\SOURCES\VAV_ENC.PRG
Called from (b)BUILDMENU(80) in .\SOURCES\VAVATA.PRG
Called from TMENU:COMMAND(1552) in .\source\classes\MENU.PRG
Called from TWINDOW:COMMAND(1109) in .\source\classes\WINDOW.PRG
Called from TMDIFRAME:COMMAND(262) in .\source\classes\MDIFRAME.PRG
Called from TMDIFRAME:HANDLEEVENT(0)
Called from _FWH(3513) in .\source\classes\WINDOW.PRG
Called from WINRUN(0)
Called from TMDIFRAME:ACTIVATE(1065) in .\source\classes\WINDOW.PRG
Called from MAIN(55) in .\SOURCES\VAVATA.PRG


Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBrowse setget
Posted: Fri Nov 08, 2019 06:20 PM

I am extremely sorry.

It is not bOnSave.

It is bOnChange

oCol:bOnChange := { |oCol, uOldVal| yourcode }

Regards



G. N. Rao.

Hyderabad, India
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: XBrowse setget
Posted: Fri Nov 08, 2019 06:37 PM

It works as expected now. Thanks a lot.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10

Continue the discussion