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 › Simple syntax question
Page Index Toggle Pages: 1
Simple syntax question (Read 794 times)
Simple syntax question
Aug 20th, 2009, 2:31pm
 
Just coming over to proccesing from learning PHP and I wanted to know if there was a way to make this bit of code valid
--------------------------
void setup(){
size(200,200);
smooth();
background(0,0,0);
String x="ellipse";
x(100,100,20,20);

}
--------------------------

I just want to replace x with ellipse to call it as a function.
Re: Simple syntax question
Reply #1 - Aug 23rd, 2009, 8:44am
 
I'm not too familiar with Processing (yet), but I do know a bit of Java and in Java this can't be done. Since Processing is written "on top" of Java, this will most likely not be possible. You will need to resort to a succession of if-statements.
Re: Simple syntax question
Reply #2 - Aug 23rd, 2009, 9:07am
 
@bartk: this message is a duplicate of Simple syntax question (a glitch of YaBB...), so better keep the discussion in one thread.
Re: Simple syntax question
Reply #3 - Aug 23rd, 2009, 10:55am
 
Thanks PhiLho, I'll keep my eye out for duplicates.
Re: Simple syntax question
Reply #4 - Aug 23rd, 2009, 11:57am
 
No problem, it is hard to track once there are separated (when one is answered).
Page Index Toggle Pages: 1