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 › Problem with writer
Page Index Toggle Pages: 1
Problem with writer (Read 623 times)
Problem with writer
Mar 2nd, 2007, 9:27pm
 
I am writing a program using writer, and everytime i try to run the program it says Type "writer" was not found. Currently I am just using the example straight from the site to test it.  Can anyone help me?

PrintWriter output;

void setup() {
 output = new writer("positions.txt"); // Create a new file in the sketch directory
}

void draw() {
 point(mouseX, mouseY);
 output.println(mouseX); // Write the coordinate to the file
}

void keyPressed() {
 output.flush(); // Writes the remaining data to the file
 output.close(); // Finishes the file
 exit(); // Stops the program
}
Re: Problem with writer
Reply #1 - Mar 2nd, 2007, 9:40pm
 
try:
output = writer("positions.txt");

F
Re: Problem with writer
Reply #2 - Mar 2nd, 2007, 9:43pm
 
oh, new Processing versions seem to have createWriter instead of writer, see here:

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

so the code should be:

output = createWriter("positions.txt");
Re: Problem with writer
Reply #3 - Mar 2nd, 2007, 9:44pm
 
Thanks for the help its grealty appreciated.
Page Index Toggle Pages: 1