XBrowse setget

Post Reply
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

XBrowse setget

Post by ADutheil »

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 BCC 5.82 MinGW 4.5.2 MSVS 10
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBrowse setget

Post by nageswaragunupudi »

This codeblock is called after a cell is edited and saved.

Code: Select all

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
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Post by ADutheil »

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

André Dutheil
FWH 13.04 HB 3.2 BCC 5.82 MinGW 4.5.2 MSVS 10
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Post by ADutheil »

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 BCC 5.82 MinGW 4.5.2 MSVS 10
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBrowse setget

Post by nageswaragunupudi »

I am extremely sorry.

It is not bOnSave.

It is bOnChange

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

G. N. Rao.
Hyderabad, India
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Post by ADutheil »

It works as expected now. Thanks a lot.
Regards,

André Dutheil
FWH 13.04 HB 3.2 BCC 5.82 MinGW 4.5.2 MSVS 10
Post Reply