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 #62609 is a reply to message #62608] Thu, 18 September 2008 14:52 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> 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.

No problem to do that here..
{ x86 Win32 Windows Microsoft Windows 7.0.1 Mar 20 2008 32 64}


pro del
for i=0,10 do begin
if i eq 5 then i = 8
print,i
endfor
end

==>
0
1
2
3
4
8
9
10

Could you comment on the "risk" of changing the loop counter within the
loop?

Jean
[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 06:57:38 PDT 2025

Total time taken to generate the page: 0.47991 seconds