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

Home » Public Forums » archive » Re: array of Julian Days
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: array of Julian Days [message #63521] Wed, 12 November 2008 10:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bulrush writes:

> On Nov 12, 9:37=A0am, David Fanning <n...@dfanning.com> wrote:
>> Bulrush writes:
>>> With the while loop, I got only 8 values, each increased just +1, e.g.
>>> 264,265,266... even if I set the step as 8. And become dead loop,
>>> looping all the day non-stop for that the same 8 values.
>>
>> Your while loop ran all day long because you never
>> changed the conditional variable. Thus, it started
>> true and it remained true. (It's probably still true
>> now!)
> Here is the updated code. How can I stop then. Why the days are not
> increasing steps of 8, and just increasing with an increment of 1?
> JDays = LINDGEN(366)
> Daystep = 265
> ; collect the days
>
> WHILE Daystep LE 363 Do Begin
> arr =D WHERE((JDays LE Daystep+8) AND (JDays GT Daystep),count)
> IF count GT 0 THEN Days =JDays[arr] ELSE days = [-1]
> print, days
> ENDWHILE

You can stop it by making the control variable "daystep"
greater than 363. You don't change it's value anywhere
in this loop, so it *stays* less than 363 forever and ever.

If you put a breakpoint in your code and step through this
a couple of times, I think eventually you will discover the
problem. :-)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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
Previous Topic: Re: convert 003 and 033 to strings
Next Topic: Workbench: Run idl several times

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

Current Time: Sat Oct 11 04:08:26 PDT 2025

Total time taken to generate the page: 1.51878 seconds