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

Home » Public Forums » archive » Re: Having trouble stopping a loop (or loop de loop de loop)
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: Having trouble stopping a loop (or loop de loop de loop) [message #62161 is a reply to message #62160] Mon, 25 August 2008 20:40 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mbweller@gmail.com writes:

> I have a few issues here that i could use some advice for:
>
> 1.) I'm not sure how to start and more importantly, end this loop. I
> chose: while e_t lt 2 do begin to start it. The problem is that this
> loop will never be greater than 2 so it will never end and it just
> keeps repeating values ad nauseum in the output file.
>
> I don't want it repeating but I'm not certain how to start it and stop
> it to allow for no repeated values.
>
> 2.) for for c=0.006, 0.01, 0.004 do begin, I watch the output, but I
> don't see it change.
>
> 3.) i must of screwed something up in this segment:
> if e_t ge 0.45 && e_t le 0.9 then openw,1,'g:\Mars_tectonics
> \IDL_programs\paper_m_data\alba_eflank.txt',
> printf,1,x,c,o,e_t,format='(3f9.3)'
>
> because it worked before, but know I keep getting an error about
> unable to close 1, or somesuch thing (just switched to compilation
> error).
>
> As always, I appreciate any help that you may provide. After all I
> wouldn't be asking this question if it weren't for all your help :)

Well, I'll leave the technical details to the experts, but I
would make two general comments. First, I would learn to indent
your code so you can read it more easily. (This may be impossible
and still have it show up properly in a post, but I find non-indented
code so obnoxious I refuse to read it, pretty much, on principle.)

And, second, I don't think in 25+ years of computer programming I have
ever used a floating point loop counter. I didn't even know it was
possible. If it *is* possible, then I envision havoc, simply by
virtue of the way floats can (or, more to the point, cannot) be
represented on computers. (I could easily be wrong about this,
but I'm just saying I've never found a reason for it, so I have
never tried it. There must be a significant difference in how
you and I think about loops.)

I think you might have bigger problems in this code then how
to get out of a loop, although I admit that is a bother. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://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
Previous Topic: Matching Lats and Lons from two arrays
Next Topic: Re: heap_free fatal error

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

Current Time: Thu Oct 09 21:35:07 PDT 2025

Total time taken to generate the page: 1.35625 seconds