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

Home » Public Forums » archive » Re: how to rerun subroutine only?
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: how to rerun subroutine only? [message #42726 is a reply to message #42722] Mon, 21 February 2005 12:57 Go to previous messageGo to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
>> this is probably a beginner question, so I appreciate your patience:
>>
>> Suppose I compile & run a top level program, then it enters a
>> subroutine. Then suppose I want the code to stop somewhere in the
>> subroutine so I can plot variables or check on/plot the results of a
>> calculation... or say the subroutine encounters an error. then I might
>> change something in the subroutine and need to rerun the subroutine.
>>
>> right now I recompile the subroutine then rerun the entire code
>> starting from the beginning of the toplevel program, when all I really
>> need to do is have idl redo the calculations from the beginning of the
>> subroutine.
>>
>> is there a way to do this?
>
>
> No. :-)
>

Short and sweet response there, David. While correct, I believe it can
be expanded just a tad. :-)

If you want your code to stop running, use the 'stop' procedure. When
your code encounters a stop, it will immediately stop executing and
you'll be left in interactive mode. You can put the stop within a catch
block of the subroutine you're working on and whenever an error is
encountered the program will stop and you'll be able to look at
variables, run other commands, etc. Just make sure to remove the stop
before distributing your program.

If you want to redo calculations of the subroutine only, you'll need to
break the subroutine out into it's own file. I don't know if anyone
else does this, but I will usually first write subroutines in their own
files just so I can easily test. Once tested somewhat, I'll move the
subroutine o the proper location within the file where the subroutine
actually belongs.

-Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: tick label problem
Next Topic: widget_base alignment question

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

Current Time: Sat Nov 29 10:56:03 PST 2025

Total time taken to generate the page: 0.00867 seconds