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

Home » Public Forums » archive » Re: IDL FOR Loop variable increments
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: IDL FOR Loop variable increments [message #62613 is a reply to message #62612] Thu, 18 September 2008 13:03 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Raghu writes:

> In the code above, i want b ( the number of bands) to be incremented
> by the value (b+k) instead of standard consistent increments of 1 or
> 2.. So, instead of b progressing from 0 to 8 as 0,1,2,3 etc..i want it
> to iterate based on the value of (b+k) derived out of the inner FOR
> loop (for k=1, j). My results run correctly but those pixels for which
> 'b' needs a (b+k) increment are not recogized by the line "if b gt 0
> and b ne (c) then continue" and so it keeps skipping all 'b'
> iterations. 'c' here is just a variable assigned to the value of b+k.
>
> Where am i going wrong ?

I think you have clearly chosen the wrong program
construction. You should NEVER be changing a loop
variable inside the loop programmatically. (I don't
think IDL 7 even allows it, since I was inadvertently
doing it the other day and got my hand slapped.) Maybe
you want a WHILE loop.

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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to countor on YZ-surface
Next Topic: Getting array indices

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

Current Time: Fri Oct 10 14:57:55 PDT 2025

Total time taken to generate the page: 1.84137 seconds