Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: how to deal...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 5601 of 6146
Post > Topic >>

Re: how to deal with problem:Loop limit expression too large for

by Allan Whiteford <allan.remove@[EMAIL PROTECTED] > Apr 4, 2008 at 01:24 PM

Magic.Zhou@[EMAIL PROTECTED]
 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
 




 6 Posts in Topic:
how to deal with problem:Loop limit expression too large for loo
Magic.Zhou@[EMAIL PROTECT  2008-04-04 05:08:00 
Re: how to deal with problem:Loop limit expression too large for
Allan Whiteford <allan  2008-04-04 13:24:05 
Re: how to deal with problem:Loop limit expression too large for
Magic.Zhou@[EMAIL PROTECT  2008-04-04 23:13:55 
Re: how to deal with problem:Loop limit expression too large for
armand.jongen@[EMAIL PROT  2008-04-05 01:24:51 
Re: how to deal with problem:Loop limit expression too large for
David Fanning <news@[E  2008-04-05 07:07:31 
Re: how to deal with problem:Loop limit expression too large for
Magic.Zhou@[EMAIL PROTECT  2008-04-06 05:19:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 22:10:00 CDT 2008.