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 › Generating an PImage Array - Not working
Page Index Toggle Pages: 1
Generating an PImage Array - Not working (Read 404 times)
Generating an PImage Array - Not working
Jun 29th, 2008, 12:30am
 
hi eyeryone,
im trying to simplyfy a facedetect-script i wrote. for initializing the images used by the script i wrote this code:

void ScreenshotsInit(){
int[] ScreenshotArray = new int[number_of_screenshots];
for (int i=0; i<ScreenshotsArray.length; i++) {
PImage ScreenshotArray [i]=
new PImage(screens_width,screens_height);
}
}

It returns the following error to the message area :
"expecting SEMI, found 'ScreenArray'"

what am i doing wrong?

greets jason
Re: Generating an PImage Array - Not working
Reply #1 - Jun 29th, 2008, 2:52pm
 
You declare the ScreenshotArray variable (should start with a lower case, to follow tradition...) as a bunch of ints, but you try to put PImages in it. Plus you shouldn't redeclare them...
Should look more like:
Code:
void ScreenshotsInit() {
PImage[] screenshotArray = new PImage[number_of_screenshots];
for (int i = 0; i < number_of_screenshots; i++) {
screenshotArray[i] =
new PImage(screens_width, screens_height);
}
}
Re: Generating an PImage Array - Not working
Reply #2 - Jun 29th, 2008, 6:59pm
 
thanks a lot PhiLho, its working fine now.

greets jason
Page Index Toggle Pages: 1