Error Block( { | e | MyFunc(), Error Dialog( e ) } )
#include "fivewin.ch"
function Main()
local bFwErr
bFwErr := ErrorBlock()
ErrorBlock( { |e| MyFunc( e ), Eval( bFWErr, e ) } )
? "Will now generate Error and see"
? Date() == 9
return nil
function MyFunc( e )
MsgInfo( e:Description + CRLF + e:Operation, "MY FUNC" )
? "Next, you will see FWH Error Dialog"
return nil
#include "fivewin.ch"
function Main()
SetPostErrorAction( { |cLogFile, e| MyFunc( cLogFile, e ) } )
? "Will now generate Error and see"
? Date() == 9
return nil
function MyFunc( cLogFile, e )
? "Sending email " + TrueName( cLogFile )
return nil
#include "fivewin.ch"
function Main()
SetErrorDialog( { |e, aStack, cErrLogText, cErrLogFile | ;
MyErrorDialog( e, aStack, cErrLogText, cErrLogFile ) } )
? "Will now generate Error and see"
? Date() == 9
return nil
function MyErrorDialog( e, aStack, cErrLogText, cErrLogFile )
MsgInfo( e:Description + CRLF + e:Operation + CRLF + ;
FW_ArrayAsList( e:Args, ", " ) + CRLF + ;
FW_ArrayAsList( aStack, CRLF ), ;
"MY ERROR DIALOG" )
return nil
ErrorBlock( { |e| MyErrorHandler( e ) } )
From this, I understand that when an error occurs, you want MyFunc() should be executed first and then invoke the FWH ErrorDialog.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 98 guests