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 › assigning new values to an array
Page Index Toggle Pages: 1
assigning new values to an array (Read 461 times)
assigning new values to an array
Apr 16th, 2006, 10:12pm
 
Hi,

I just want to figure out how to assign new values to the array called shape that is defined here:

int [] shp = new int[shpAmt];

I tried to do this:
   if(keyPressed) { if (key == 'p') { shp[] = new shp( 1, 48, 43, 28, 21, 31, 24, 39, 0, 0, 0, 0 ); } }  

- but got this message: VariableDeclaratorld expected after this token.
what did I do wrong?

thanks for your help,
annemarie
Re: assigning new values to an array
Reply #1 - Apr 16th, 2006, 10:46pm
 
Remove the [] in your assignment:
Code:
shp = new shp( 1, ... 



Marcello
Page Index Toggle Pages: 1