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.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › Error in reference example for draw().
Page Index Toggle Pages: 1
Error in reference example for draw(). (Read 1362 times)
Error in reference example for draw().
May 29th, 2009, 3:07pm
 
I am a newbie and enjoying learning Processing.

In the reference for draw() the first example code listing has an error.

Line 9 reads:

 if(yPos  0) {

should read ( I presume)

 if(yPos > 0) {





[snipped from reference]

float yPos = 0.0;

void setup() {
 size(200, 200);
 frameRate(30);
}

void draw() {
 background(204);
 yPos = yPos - 1.0;
 if(yPos  0) {
   yPos = height;
 }
 line(0, yPos, width, yPos);
}
Re: Error in reference example for draw().
Reply #1 - Oct 18th, 2009, 9:56am
 
Thank you for catching this. It will be fixed for the next release.
Page Index Toggle Pages: 1