Bug 738 : Applet won't export
Last modified: 2008-02-26 10:17




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
frankh
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-02-26 09:58
Processing 135. Mac OS 10.4.10. Java 1.5.0_07

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)

A user on the forum was able to export the code on an Mac G5, MAc OS X
10.5.2, and Java 1.5.0_13.

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() {}

[/code]
Additional Comment #1 From fry 2008-02-26 10:05
That's because your sketch is named "final", which is a keyword in the
language.
Additional Comment #2 From frankh 2008-02-26 10:17
Fry, thank you. much appreciated.