Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.idl-pvwave

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2009, 10:58 PM
Elkunn
Guest
 
Posts: n/a
Default number of iterations

Hi Folks,
Is there a way to count the number of iterations in a Repeat.. Until
Loop?

thanks
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 12-06-2009, 11:49 PM
David Fanning
Guest
 
Posts: n/a
Default Re: number of iterations

Elkunn writes:
..
> Is there a way to count the number of iterations in a Repeat.. Until
> Loop?


I suppose something like "count =+" would work. ;-)

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.")
Reply With Quote
  #3 (permalink)  
Old 12-07-2009, 12:32 AM
Elkunn
Guest
 
Posts: n/a
Default Re: number of iterations

On Dec 6, 6:49*pm, David Fanning <n...@dfanning.com> wrote:
> Elkunn writes:
>
> .
>
> > Is there a way to count the number of iterations in a Repeat.. Until
> > Loop?

>
> I suppose something like "count =+" would work. ;-)
>
> 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.")

How can I do that in this example? I would like to have print the
number of iterations within that Repeat Loop.

Thanks
;E1 = Unit vector, known
; Z is known matrix
REPEAT BEGIN
EC = Z##E1
L = sqrt(EC[0]+EC[1])
E1 = EC/L
print,L
;Keep going until nothing is moved.
ENDREP UNTIL L LT 1.2840277
Reply With Quote
  #4 (permalink)  
Old 12-07-2009, 12:37 AM
David Fanning
Guest
 
Posts: n/a
Default Re: number of iterations

Elkunn writes:
..
> How can I do that in this example? I would like to have print the
> number of iterations within that Repeat Loop.
>
> Thanks
> ;E1 = Unit vector, known
> ; Z is known matrix
> REPEAT BEGIN
> EC = Z##E1
> L = sqrt(EC[0]+EC[1])
> E1 = EC/L
> print,L
> ;Keep going until nothing is moved.
> ENDREP UNTIL L LT 1.2840277


;E1 = Unit vector, known
; Z is known matrix
count = 0
REPEAT BEGIN
print, count++
EC = Z##E1
L = sqrt(EC[0]+EC[1])
E1 = EC/L
print,L
;Keep going until nothing is moved.
ENDREP UNTIL L LT 1.2840277



--
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.")
Reply With Quote
  #5 (permalink)  
Old 12-07-2009, 12:50 AM
Elkunn
Guest
 
Posts: n/a
Default Re: number of iterations

On Dec 6, 7:37*pm, David Fanning <n...@dfanning.com> wrote:
> Elkunn writes:
>
> .
>
> > How can I do that in this example? I would like to have print the
> > number of iterations within that Repeat Loop.

>
> > Thanks
> > * * ;E1 = Unit vector, known
> > * * ; Z is *known matrix
> > * * REPEAT BEGIN
> > * * * * EC = Z##E1
> > * * * * L = sqrt(EC[0]+EC[1])
> > * * * * E1 = EC/L
> > * * * * print,L
> > * * * * ;Keep going until nothing is moved.
> > * * ENDREP UNTIL L LT 1.2840277

>
> * * ;E1 = Unit vector, known
> * * ; Z is *known matrix
> * * count = 0
> * * REPEAT BEGIN
> * * * * print, count++
> * * * * EC = Z##E1
> * * * * L = sqrt(EC[0]+EC[1])
> * * * * E1 = EC/L
> * * * * print,L
> * * * * ;Keep going until nothing is moved.
> * * ENDREP UNTIL L LT 1.2840277
>
> --
> 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.")


Wov!
Things are so simple, as long as you know how to do it!!!
thanks
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
flags for derivative sign c http://alexslemonade.org Newsgroup comp.lang.fortran 1 10-28-2009 11:54 AM
flags for derivative sign c http://alexslemonade.org Newsgroup comp.lang.scheme 1 10-28-2009 11:54 AM
Checking if a Mumps variable is a number or not? David Hubball Newsgroup comp.lang.mumps 12 10-27-2009 11:14 PM
Treedisc Macro Alex Murphy Newsgroup comp.soft-sys.sas 0 04-28-2009 07:04 AM
Lock requests not available due to conflicts? Mark Newsgroup comp.databases.berkeley-db 0 04-18-2009 02:04 AM



All times are GMT. The time now is 02:26 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.