error handler acting odd

Post Reply
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

error handler acting odd

Post by don lowenstein »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: error handler acting odd

Post by Antonio Linares »

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: Select all

function Main()

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: error handler acting odd

Post by Antonio Linares »

A simpler way is to compare the codeBlocks:

Code: Select all

function Main()

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

Antonio Linares
www.fivetechsoft.com
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Re: error handler acting odd

Post by don lowenstein »

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
Post Reply