We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › x dimensional arrays - out of bounce
Page Index Toggle Pages: 1
x dimensional arrays - out of bounce (Read 436 times)
x dimensional arrays - out of bounce
Nov 10th, 2005, 11:00pm
 
hi,

i want to access a filled array, but it gives an exception...

// before setup
int[][] colors={{10,60,120,80},{100,5,10,80},{50,110,30,50}};
int[][][][] reminder = new int[50][colors.length][1][2];

then i want to access the array linke this:
reminder[0][0][0][0]=var;
it works. it seems that no error occured.

but it excepts with an out of bounce 0, when i try to print the array with:

println(reminder[0][0][0][0]);

note: when i use for the second [] an the third [] a counter variable from two loops - i and k - than it works.

whats wrong?

thanks

s/w

p.s.
sorry. i am a php-jammer. not java. Smiley
processing is my first contact with java.

p.p.s.
Re: x dimensional arrays - out of bounce
Reply #1 - Nov 11th, 2005, 3:29pm
 
that code should work just fine.. the out of bounds is probably something with how your loop is set up. could you post the actual code?
Page Index Toggle Pages: 1