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.
Page Index Toggle Pages: 1
Export Error (Read 471 times)
Export Error
Mar 12th, 2006, 11:26pm
 
Sometimes I get an error when exporting Applets in P107.

The error is:
Error while exporting

It happens only sometimes, and this occurred while using this code:


Code:

import processing.opengl.*;
import saito.objloader.*;

public class P5GE extends PApplet {
OBJModel m;
String words = "apple bear cat dog";
String list[] = split(words);

static public void main(String args[]) {
PApplet.main(new String[] { "--present","--bgcolor=#000000","--present-stop-color=#000000","P5GE"});
}

// Setup
void setup(){
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
size(screen.width,screen.height,OPENGL);
// m =
}

// Main loop
void draw() {
background(mouseX,mouseY,(mouseX+mouseY)/2);
if ( mousePressed ) { saveStrings("nouns.txt", list); }
}

}


The red error messages didn't tell me much, and the bug is only reproducable only some of the time.  It happened when I tried to export and the name of the file was not the same as the class.  It might be nice to add some functionality that supports extending PApplet such that you wouldn't have to write the above code "public class <name> extends PApplet",
perhaps a special symbol that could appear after "import"

Code:

extend PApplet {

static ... void main() { ... }
}

Re: Export Error
Reply #1 - Mar 13th, 2006, 12:12am
 
just don't extend PApplet. there's no need for that in your code, and when you do it, you're telling processing that you know what you're doing--i.e. will keep the name of the class the same as the sketch. if you don't want to do that, then don't put the "extends PApplet" line in there.
Page Index Toggle Pages: 1