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 & HelpPrograms › applet won't export (mac 10.4.10, p135)
Page Index Toggle Pages: 1
applet won't export (mac 10.4.10, p135) (Read 649 times)
applet won't export (mac 10.4.10, p135)
Feb 4th, 2008, 2:47am
 
I have a pde file that runs fine within processing. When I export to an applet, it throws this error:

final.java:1:621:1:625: Syntax Error: Identifier expected instead of this token

Processing 135. Mac OS 10.4.10. Java 1.5.0_07

The file is long but I can post it if that would help.

Any thoughts?

Re: applet won't export (mac 10.4.10, p135)
Reply #1 - Feb 25th, 2008, 3:56am
 
I get the same error when exporting in p135 in windows. Can anyone explain the line numbers, to guide me towards a solution?

final.java:1:621:1:625: Syntax Error: Identifier expected instead of this token
Re: applet won't export (mac 10.4.10, p135)
Reply #2 - Feb 25th, 2008, 2:07pm
 
I don't know anything about Java and not much more about Processing, so maybe I'm not the most suitable person to answer here.

I think that you could get better feedback if you provided more information. For example the code you are triying to export. Or, even better, a minimal sketch that showed the problem. With that information, other people (like me) could try to reproduce the problem and solve it.

Javier
Re: applet won't export (mac 10.4.10, p135)
Reply #3 - Feb 25th, 2008, 10:06pm
 
Thanks Javier for the feedback. I've stripped the code down as much as possible.

This file will run within processing, but not export. I can export other files to applets without any problems.

The error I get when trying to export is:
/Users/frank/6.914/final project/final merged/final/applet/final.java:1:621:1:625: Syntax Error: Identifier expected instead of this token

processing.app.RunnerException: Identifier expected instead of this token at processing.app.Compiler.message (Compiler.java:360) at processing.app.MessageSiphon.run( MessageSiphon.java:60) at java.lang.Thread.run (Thread.java:552)

The pde file:

Code:

//object array for countries
CountryObject[] country = new CountryObject[1];

void setup(){
size(1000, 500); // window of size 500 x 500
setupCountries();

}

void draw(){ background(100);}

class CountryObject {

//attributes
String name;
int[] pop = new int[101];
float[] percentUrban = new float[101];
float xPos;
float yPos;
int[] neighbor = new int[5]; //upper limit on # neighbors

//constructor
CountryObject (String n, float x, float y) {
name = n;
xPos = x;
yPos = y;

}

void drawBlob(int firstYear, int secondYear) {
}

void loadPop(String fiveYearPop) {}
void loadNeighbors(int n0, int n1, int n2, int n3, int n4) {}
void loadUrb(String fiveYearUrb) {}
void printPopArray() {}
void printUrbArray() {}
}

void writeLog(String logString) {}
void checkPause() {}
float adjustedXPos(float x) {return 1;}
float adjustedYPos(float y) { return 1;}
void drawInfo() {}
String numFormat(float pop) {return "foo";}
void drawUI() {}

void setupCountries() {}



Modified 2/25 to fix code formatting, thanks Javier.
Re: applet won't export (mac 10.4.10, p135)
Reply #4 - Feb 25th, 2008, 11:30pm
 
Hi!

First of all, I think that the best way to write code is between [ code ] and [ /code ] (remove the spaces). Like here:

Code:
 //object array for countries
CountryObject[] country = new CountryObject[1];

void setup(){
size(1000, 500); // window of size 500 x 500
setupCountries();

}


I have run your piece of code and it run without error. After that I exported the application, and everything seems to be fine. I tried it in an iMac G5, MAc OS X 10.5.2, and Java 1.5.0_13. Maybe there is a problem with your system.
Re: applet won't export (mac 10.4.10, p135)
Reply #5 - Feb 26th, 2008, 7:19pm
 
I filed a bug - in response, Fry pointed out that my file was called "final", which is a reserved word.

Changing the filename allows the file to export without any problems.
Page Index Toggle Pages: 1