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

Home » Public Forums » archive » Re: how to check if a loop fails
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 check if a loop fails [message #66260 is a reply to message #66259] Sun, 26 April 2009 12:36 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 26, 11:21 am, xiao <littledd...@gmail.com> wrote:
> hmm.....David, I tried the processbar like this:
>
> for j=0,7 do begin
>
>      progressBar = Obj_New("SHOWPROGRESS", /AutoUpDate, Delay=5,
> Steps=20)
>    progressBar->Start
>    Obj_Destroy, progressBar
>
> .......
>
>  endfor
>
>  And it does move for the first step but it disappeared  after that.
> Sigh.....
>
>                             Xiao
>
> On Apr 26, 10:49 am, David Fanning <n...@dfanning.com> wrote:
>
>> xiao writes:
>>>   I have a loop including several functions and when I run the
>>> program, I wait for a long time and the loop is still running. I
>>> wonder if the loop is already dead. Any ideas how I can check it?
>
>> Checking for error messages comes to mind. :-)
>
>> You could also try a progress bar. It it doesn't move for
>> 5 or 10 minutes you might conclude your loop was dead:
>
>>   http://www.dfanning.com/widget_tips/show_progress.html
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>

progressBar = Obj_New("SHOWPROGRESS", /AutoUpDate, Delay=5,Steps=20)
progressBar->Start
for j=0,7 do begin
.......
endfor
Obj_Destroy, progressBar

But even easier would be to:
1- step through the code using the debugger
2- add print statements to inspect variables

for j=0,n-1 do begin
print, 'Step ' + strtrim(j+1,2) + ' of ' + strtrim(n,2) + ' steps'
.......
endfor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to check if a loop fails
Next Topic: passing variable error

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

Current Time: Mon Dec 01 16:08:19 PST 2025

Total time taken to generate the page: 1.99566 seconds