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 #42722 is a reply to message #42721] Mon, 21 February 2005 13:32 Go to previous messageGo to previous message
kashyap is currently offline  kashyap
Messages: 26
Registered: April 1993
Junior Member
In article <1109014029.766542.64110@g14g2000cwa.googlegroups.com>,
<u2s5thmember@yahoo.com> wrote:
> 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?
>
> thanks in advance for your time!

Depends..

There is no way to move flow control to the beginning of the
program (that I know of), but if simple debugging is all you
want to do, then yes.

First get out of the subroutine with a ".out" or a "return" or
a "return,-1", then recompile that subroutine (if it is in a
separate file; this won't work if subroutine is in the same file
as the main program), and simply call it with the same calling
sequence as you did in the main program. Make sure you feed it
the right variables in the parameters, because they may have
changed in value or property in the interim.

Vinay
--
____________________________________________________________ __________________
kashyap@head.cfa.harvard.edu 617 495 7173 [CfA/P-145] 617 496 7173 [F]
[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: Sun Nov 30 01:00:43 PST 2025

Total time taken to generate the page: 0.88073 seconds