comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDLVM and retall
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDLVM and retall [message #50003 is a reply to message #50002] Thu, 07 September 2006 15:57 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 07 Sep 2006 13:14:12 -0600, David Fanning wrote:

> JD Smith writes:
>
>> Imagine you are in some deep level of the calling stack in a complex
>> widget program, and an error occurs. If you are running
>> interactively, you'd like to report the error to the user with a
>> dialog, and then after they dismiss it, continue running the
>> application. The only way to do this simply is to use RETALL, which
>> returns all the way to the active command line (a fact many have
>> discovered: when a widget app crashes, use RETALL and you're often
>> back in business).
>
> But why use RETALL!? I've always just used RETURN
> in these cases and widget programs continue to
> run pretty much forever, VM or not. Is there someplace
> you are trying to get to with RETALL that you don't
> get to with RETURN?


Here's a better example:

pro MyClass:f1, ev
if something_is_wrong self->Error
do_calc
end

pro MyClass:f2,ev
self->f1,ev
do_another_calc
end

> Can this be a difference between Windows and UNIX?

If you simply return (or return twice, if you were able to do that
from within self->Error), you'd be right back inside MyClass:f2 and
do_another_calc would run, which is not what you want. With RETALL,
the entire calling stack is returned from, not just one step in the
stack. A single RETURN only works if you are at the very tip of a
calling stack that will neatly fold up as soon as you go off the end.
It so happens that event callback functions work this way, so if your
errors always occur and are dealt with there, RETURN may be equivalent
to RETALL. The point is to be able to "continue with processing"
after issuing an error anywhere in the calling stack. This isn't
guaranteed to be a good idea (since the error may leave you in a state
such that further processing will continue the breakage), but if
you're careful, it's a nice way to abort whatever you were doing when
the breakage occurred.

Or am I missing something? Do you have a way of returning a widget
program to running anywere from anywhere in the calling stack? Keep
in mind that there are many many event callback procedure operating
simultaneously, so you don't want to put a CATCH statement in all of
them (plus it's slow for each motion event to call CATCH).

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ascii_template advanced
Next Topic: IDLVM and retall

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:25:48 PDT 2025

Total time taken to generate the page: 0.00438 seconds