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

Home » Public Forums » archive » Re: how to deal with problem:Loop limit expression too large for loop variable type.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: how to deal with problem:Loop limit expression too large for loop variable type. [message #59650] Fri, 04 April 2008 05:24 Go to next message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
Magic.Zhou@gmail.com wrote:
> i just code a for function
> for i=0, ArraySize do begin
> if (Seg_Grey_Image[i] le 255) and (Seg_Grey_Image[i] ge 240) then
> begin
> Seg_Grey_Image[i]=255
> endif
> endfor
> however, the error is :Loop limit expression too large for loop
> variable type.
> it seems this 'ArraySize' is too big. how can I deal with this
> problem?
> Thank you!

Change:

"for i=0, ArraySize do begin"

to

"for i=0L, ArraySize do begin"

(note the addition of a capital 'L' after the zero).

If you set your loop variable to be a normal (2 byte) integer you can
only loop up to 32,768. Adding in the 'L' sets it to a long (4 byte)
integer.

Thanks,

Allan
Re: how to deal with problem:Loop limit expression too large for loop variable type. [message #59718 is a reply to message #59650] Fri, 04 April 2008 23:13 Go to previous message
Magic.Zhou is currently offline  Magic.Zhou
Messages: 16
Registered: April 2008
Junior Member
OK, I get that, seem I always some details in programming. thank you!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Anyone link GSL into IDL?
Next Topic: How to change the 3D visual angel?

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

Current Time: Wed Oct 08 15:57:32 PDT 2025

Total time taken to generate the page: 0.00551 seconds