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
custom methods (Read 559 times)
custom methods
Sep 14th, 2005, 11:39pm
 
Hey people,

I just started using processing in my projects and I am desperately wondering the guidelines for building custom functions. I tried to make something like

void foo() {
println('foo');
}

foo();

but it throwed me couple of errors.

Should I be using draw() and setup() as my main functions and calling custom functions inside of them more in a child father relationship?

I really appreciate your comments on that.

ilteris.
Re: custom methods
Reply #1 - Sep 15th, 2005, 7:23am
 
yes :] you should be using setup and draw

something like

void setup()
{}
void draw()
{
 foo();
}

void foo()
{
//dosomething
}
Page Index Toggle Pages: 1