For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2006 > Setting/Using Exit Handlers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Setting/Using Exit Handlers
R. MacDonald

2006-03-27, 8:00 am

Hello, All,

I would like to learn something about creating and using exit handlers.

My immediate goal is to catch:

- unhandled I/O or allocation errors
- calls to Exit, Stop, Abort

from a Fortran DLL to prevent these from causing termination of the
application that called the DLL. I would like to "convert" the
termination into an error that can be handled by the calling
application. I am working with IVF in a W2K environment.

Is this possible?

I have been experimenting with SIGNALQQ (e.g.

SIGNALQQ(SIG$TERM, h_error)
and
SIGNALQQ(SIG$ABORT, h_error)

but without success. (The declared handler is called correctly if I
call RAISEQQ with the appropriate signal, but not when the application
is actually terminating.)

I would really appreciate it if anyone can point me to an appropriate
reference that will get me started.

Cheers,
Randy
Steve Lionel

2006-03-27, 7:02 pm

On Mon, 27 Mar 2006 12:51:47 +0200, "R. MacDonald" <scitec@NO-SP-AMcips.ca>
wrote:

>I would like to learn something about creating and using exit handlers.
>
>I would really appreciate it if anyone can point me to an appropriate
>reference that will get me started.


I don't have much experience on this topic, but I'd suggest for a start
reading the chapter on Error Handling in the Intel Visual Fortran Building
Applications Manual. It discusses termination handlers. You could probably
get good advice from other experienced users in our user forum - see link
below.

Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/
R. MacDonald

2006-03-27, 7:02 pm

Hello, Steve,

Thanks for your reply. I had seen the chapter that you mention. As
near as I can tell, it says that my options are to:

a) Not let any unhandled errors happen.

Failing that, then

b) Use C wrappers to do "Windows Structured Exception".

I guess that b) is the option that I will need to pursue.
Unfortunately, there doesn't seem to be any information or examples in
the manual about how to do this. (That's fair enough. It IS a Fortran
manual after, all.)

But on reviewing the chapter again I see a reference I had missed on my
earlier pass ("Advanced Windows" by Jeffrey Richter). Perhaps I will
try to find that book and see what I can learn from it.

Knowing that I can't do it in Fortran IS already valuable information.
I will broaden my search to see if I can find any examples from other
languages.

Thanks also for the reference to the user forums. This will certainly
be helpful for other problems that may arise. (I may eventually try
these for this problem also, but I will do a little more research first.)

Cheers,
Randy


Steve Lionel wrote:
> On Mon, 27 Mar 2006 12:51:47 +0200, "R. MacDonald" <scitec@NO-SP-AMcips.ca>
> wrote:
>
>
>
>
> I don't have much experience on this topic, but I'd suggest for a start
> reading the chapter on Error Handling in the Intel Visual Fortran Building
> Applications Manual. It discusses termination handlers. You could probably
> get good advice from other experienced users in our user forum - see link
> below.
>
> Steve Lionel
> Developer Products Division
> Intel Corporation
> Nashua, NH
>
> User communities for Intel Software Development Products
> http://softwareforums.intel.com/
> Intel Fortran Support
> http://developer.intel.com/software/products/support/

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com