|
|
Re: error: subscript range values of the form low:high must be >= 0, < size [message #63193 is a reply to message #63192] |
Fri, 31 October 2008 11:31  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
Well, to debug this program, add a
print,numClicks
statement in the if clause and you'll see what's going on...
Ciao,
Paolo
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
|
|
|