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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: how to check if a loop fails [message #66259] Sun, 26 April 2009 17:50
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Apr 26, 2:36 pm, Vince Hradil <vincehra...@gmail.com> wrote:
> 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

haha, Thank you very much
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 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
Re: how to check if a loop fails [message #66261 is a reply to message #66260] Sun, 26 April 2009 09:21 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
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.")
Re: how to check if a loop fails [message #66262 is a reply to message #66261] Sun, 26 April 2009 08:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Fri Oct 10 01:04:57 PDT 2025

Total time taken to generate the page: 1.20073 seconds