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 › array usage creates error
Page Index Toggle Pages: 1
array usage creates error? (Read 419 times)
array usage creates error?
Oct 22nd, 2005, 9:18pm
 
n00b here, can't see why this causes an error ..

-------
int[] numbers = new int[3];
numbers[0] = 90;

void setup() {
 size(200, 200);
}
-------
when I run this, it says "unexpected token: void"

running the following does not generate the error

-------
int[] numbers = new int[3];
//numbers[0] = 90;

void setup() {
 size(200, 200);
}
--------

I'm using version 0093

Re: array usage creates error?
Reply #1 - Oct 22nd, 2005, 9:35pm
 
oops, I found an answer to this a few posts down.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=display;num=1128806817

short answer, array needed to be populated inside of setup
Page Index Toggle Pages: 1