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

Home » Public Forums » archive » Re: loop limit ???
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: loop limit ??? [message #53584 is a reply to message #53583] Wed, 18 April 2007 14:12 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Apr 18, 2:54 pm, kostis <kostis...@gmail.com> wrote:
> i wouldnt expect that IDL has a limit for loops !!
> trying a loop of 50.000 steps i got the message:
>
> % Compiled module: TRAJECTORY.
> % Loop limit expression too large for loop variable type.
> <LONG ( 49999)>.
> % Execution halted at: TRAJECTORY 16 /home/kostis/PROJECT
> LARMOR/dipole/trajectory.pro
> % $MAIN$
>
> Why is this?
> This means i cant have bigger loops... or is there a trick??

There's a "trick". A FOR loop variable gets it type from the "start"
value of the loop and it doesn't change in the course of the loop.

So, (note the 0L -- it's the "trick"):

for i = 0L, 50000L do begin
; stuff here
endfor

should do it for you.

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help with the F-test. mpftest.pro in particular.
Next Topic: Re: Annoying ROIs

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

Current Time: Sun Oct 12 09:27:53 PDT 2025

Total time taken to generate the page: 2.16265 seconds