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

Home » Public Forums » archive » Re: repeat vs. while
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: repeat vs. while [message #82154] Wed, 21 November 2012 14:37 Go to previous message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Wednesday, November 21, 2012 2:16:05 PM UTC-7, David Fanning wrote:
> rr...@stsci.edu writes:
>
>
>
>> Can anyone explain the difference between repeat and while? Is there any reason to use one vs. the other?
>
>
>
> REPEAT will check the loop condition at the bottom of the loop.
>
> WHILE will check the loop condition at the top of the loop.
>
>
>
> You use one or the other depending on when you want to
>
> stop executing the loop.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Another way of thinking of this is that REPEAT is guaranteed to execute at least once, whereas WHILE may execute zero times.

mp
[Message index]
 
Read Message
Read Message
Previous Topic: Re: picking an option with radio buttons
Next Topic: Unicode in IDL

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

Current Time: Wed Oct 08 15:52:33 PDT 2025

Total time taken to generate the page: 0.00382 seconds