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

Home » Public Forums » archive » error: subscript range values of the form low:high must be >= 0, < size
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: error: subscript range values of the form low:high must be >= 0, < size [message #63301 is a reply to message #63194] Mon, 03 November 2008 15:54 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
frankosuna wrote:
> I am trying to store values into a array of type long but I keep
> getting the following error:
> subscript range values of the form low:high must be >= 0, < size, with
> low <= high: ROIPIXELS.
> The weird thing about it is when I set a breakpoint and step through
> the code it doesn't throw the error anymore. Also, if instead I don't
> use numClicks as the index and hardcode a 0 or 1 or 2...etc the code
> works as well!!!
>
> HELP!!!!!!!!!
>
> roiPixels = LONARR(5,25)
> numClicks = 1
>
> WHILE(!mouse.button NE 4) DO BEGIN
> CURSOR, xi, yi, /DEVICE
> IF(!mouse.button EQ 1) THEN BEGIN
> x = LINDGEN(5*5) MOD 5 + xi
> y = LINDGEN(5*5) / 5 + yi
> roiPixels[numClicks,*] = x + y * 1024
> numClicks++
> ENDIF
> ENDWHILE

if you click 6 times, numClicks = 7, which is greater than the 1st
dimension of roiPixels...
You might want to resize roiPixels as numClicks grows (or start with a
bigger array, and cut the unused entry when you are done)
Jean
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Multiple click region growing
Next Topic: Coyote as Mac User

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

Current Time: Sat Oct 11 15:27:28 PDT 2025

Total time taken to generate the page: 1.44238 seconds