error handler acting odd

error handler acting odd

Postby don lowenstein » 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
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: error handler acting odd

Postby Antonio Linares » Tue Jul 21, 2020 3: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: Select all  Expand view  RUN
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: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: error handler acting odd

Postby Antonio Linares » Tue Jul 21, 2020 4:13 am

A simpler way is to compare the codeBlocks:

Code: Select all  Expand view  RUN
function Main()

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

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

Re: error handler acting odd

Postby don lowenstein » Tue Jul 21, 2020 4: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
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests