FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour error handler acting odd
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
error handler acting odd
Posted: Mon Jul 20, 2020 10:00 PM

My error handler seems to be odd.
this just recently began.
It's not staying set on my default handler.

Is there a way to view the current error handler's target function it is currently set to?

Windows 10
MS-Visual C++ version 19
Harbour 3.2.0
FWH1095

the only thing different in my environment is a recent Windows Update.

Don Lowenstein
www.laapc.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: error handler acting odd
Posted: Tue Jul 21, 2020 03:51 AM
Don,

Harbour uses function ErrorBlock( bNewErrorBlock ) --> bPreviousErrorBlock to set/retrieve the errorblock.
As it uses a codeBlock as the param there is no way to retrieve the used function from the codeBlock.

Anyhow, you can use the function __vmItemId( codeBlock ) to check the codeblock unique ID:
Code (fw): Select all Collapse
function Main()

   local bErrorBlock := { || nil }
   
   ? __vmItemId( bErrorBlock )
   
   ? __vmItemId( ErrorBlock() )  // this one is different from bErrorBlock
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: error handler acting odd
Posted: Tue Jul 21, 2020 04:13 AM
A simpler way is to compare the codeBlocks:

Code (fw): Select all Collapse
function Main()

   local bErrorBlock := { || nil }
   
   ? bErrorBlock == ErrorBlock()
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: error handler acting odd
Posted: Tue Jul 21, 2020 04:41 PM

I found my problem thanks to your help, Antonio.

I trust all is well with you and wishing you the best.

Thank you.
Don

Don Lowenstein
www.laapc.com

Continue the discussion