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 › Quick verification about "this"...
Page Index Toggle Pages: 1
Quick verification about "this"... (Read 555 times)
Quick verification about "this"...
May 20th, 2005, 8:11am
 
In regular java, it's possible to do:
Code:
class Foo {
int x;
Foo(int _x){
this.x = _x;
}
Foo(){
this(5);
}
}

But I've noticed in Processing that this isn't working out correctly, saying something like "Unexpected '('". Am I doing it wrong, or is this just not possible at the moment?

[edit]
Well, that's strange, but somehow it seems to work now. I think I know why, too. I had something like
Code:
class C {
C(){
this("Blah");
}
C(String b){
print(b);
}
otherMethod(){
...
}
}

So I think that since the "otherMethod()" didn't have void in front of it, it was throwing the interpreter off.

I like figuring things out!
Page Index Toggle Pages: 1