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

Home » Public Forums » archive » FOR loop ends one above where it's supposed to
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
FOR loop ends one above where it's supposed to [message #71138] Tue, 01 June 2010 17:26
Bulgakovv is currently offline  Bulgakovv
Messages: 2
Registered: June 2010
Junior Member
Maybe there are previous posts about this, but I tried to google
around without any success so I'll throw the question out.

When I make a FOR loop from for example 0 to 5, the counter ends on
the value one step above what I stated. Here's an example:

> for i =0,5 do print,i
0
1
2
3
4
5
> print,i
6

Is this how it's supposed to be in IDL? To me it seems a little bit
weird, why would the FOR loop count one extra step in the end? Took me
a couple of hours to realize what was going on in my code as I took
for granted this was not the case, so now I'm interested in
understanding why IDL is behaving like this. Thanks and sorry if
reposting!
[Message index]
 
Read Message
Previous Topic: How to set the multiple xaxis labels
Next Topic: Re: How to set the multiple xaxis labels

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

Current Time: Wed Oct 08 15:37:45 PDT 2025

Total time taken to generate the page: 0.00364 seconds