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

Home » Public Forums » archive » Re: a BUG or not a BUG in IDL ?
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: a BUG or not a BUG in IDL ? [message #6635 is a reply to message #6629] Fri, 19 July 1996 00:00 Go to previous messageGo to previous message
g.d.nowicki is currently offline  g.d.nowicki
Messages: 2
Registered: July 1996
Junior Member
In article <4smb8g$5o@lace.colorado.edu>, liziola@piura.colorado.edu says...
>
> I have a "warning in loops" for you guys...
> Check this "stupid" routine:
>
> ;---------------------------------------
> print,'Integers'
> J = 0
> for I = 1,10 do begin
> print,I
> I = I + J
> endfor
>
[other code deleted]
> ;----------------------------------
>
> The first loop if OK, the second loop stops after the first
> iteration, but the last loop, just keeps going forever...
>
> Any comments ?
> At least should be a "WARNING" in the manual...
>
> Luis
> University of Colorado
>

HOLD IT!!!

You all seem to be missing the point. There is no language I know of that
recommends you modify a control variable within a FOR/DO loop. Results are
unpredictable. If fact, there are a fair number of compilers out there
that will produce an error if you mess with the control variable, not just a
warning.

As with any language, there are ways to shoot yourself in the foot. IDL
just allows you to do it differently.

-Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: missing data
Next Topic: reading files into arrays

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

Current Time: Sat Oct 11 03:59:31 PDT 2025

Total time taken to generate the page: 1.20432 seconds