| Re: DLM's and C code [message #28866 is a reply to message #28779] |
Fri, 11 January 2002 17:53  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Richard Tyc" <Richard_Tyc@sbrc.umanitoba.ca> writes:
> Thanks Craig,
>
> I am now using IDL_MSG_LONGJMP since in many cases IDL_MSG_RET does not get
> me back to the C function called by the IDL interpreter (ie. the function
> found in the *.dlm file which can be called from within IDL). Typically ,
> the error is deeply nested in another c function inside a linked in DLL or
> simply another C function not "visible" to IDL but in the same overall *.c
> program compiled with MAKE_DLL.
>
> I am a bit surprised LONGJMP works since the docs say :
> "... It is an error to use this action code in code not called by the IDL
> interpreter since the resulting call to longjmp() will be invalid. "
>
> But, a seemingly safe return to the IDL command line occurs with the
> message:
> % Execution halted at: $MAIN$
>
> Go figure....
Hi Rich--
I'm still not sure you are getting it :-)
If you have a situation like this:
IDL interpretter calls FUNC.PRO, which calls dlm function X, which
calls Y which calls Z
and an error occurs in "Z" then here are the possibilities:
* IDL_MSG_LONGJMP will always return to IDL, skipping X, Y and FUNC.PRO
(by return to IDL I mean return to the IDL command line)
* IDL_MSG_RET will always return to FUNC.PRO
If you want to return to X or Y, then skip all that IDL nonsense and
setup your own setjmp()/longjmp() calls.
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
|