Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OnError?

davidgraham
Beginner
276 Views
Is there an "OnError" function like Visual Basic so you can control a Runtime error?
So you could have a button to get the users to send an email of the error message.
I know you can heve ERR in commands.
Thanks,
David
0 Kudos
2 Replies
Steven_L_Intel1
Employee
276 Views
No, there is not an equivalent. You should read the chapter on error handling in the Building Applications manual to see what is available to you.
0 Kudos
Intel_C_Intel
Employee
276 Views
Hi David,

The chapter Steve recommends on error handling is very useful. The available error trapping options like ERR, END, STAT, etc. are very useful to catch run-time errors.

We use mixed VB and Fortran in our software and have had to devise additional steps for error trapping. Since a DLL cannot write to the "screen" we use both a text log file for error messages and a message string that is passed from the DLL back to the calling routine. Then we can give helpful advice to the user or instructions on submitting an error report to us. In addition to the error trapping available in the intrinsic routines, our additional data checking to avoid division by zero or the square root of -1, we update the error message string and use a GO TO statement to jump to the end of the routine to gracfully exit the routine (deallocate local arrays, close files) and then exit the DLL.

Regards,
Greg
0 Kudos
Reply