Shop OBEX P1 Docs P2 Docs Learn Events
IndexOutOfBoundException — Parallax Forums

IndexOutOfBoundException

StereoPonyzStereoPonyz Posts: 82
edited 2010-01-09 17:41 in General Discussion
Hi Peter, May i know how to solve IndexOutOfBoundException? I need to use a calculation to determine if the result satisfy an equation as shown in case6
--> if (mulr + muly - mulr <= 0).

mulr, muly and mulr is a mulitplication of itself. I realise that if there is multiplication IndexOutOfBoundException will occur. I tried without multiplication and the codes can run fine.

finx = Boebot3x - x;
mulx = finx*finx;
finy = Boebot3y - y;
muly = finy*finy;
mulr = r*r;

I had read through the manual, is it due to Javelin being unable to perform Garbage collection. However, i need to perform the check using the equation.

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2010-01-09 17:41
    IndexOutOfBounds relates to an array.
    So it must be that either buf[noparse]/noparse or value[noparse]/noparse·is too small.
    It cannot be value[noparse]/noparse because that only needs to store one integer.

    Increase the size of buf, eg. buf[noparse][[/noparse]256]
    That should be large enough to hold at least 4 messages.

    regards peter
Sign In or Register to comment.