FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   javascript's eval()
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: javascript's eval()  (Read 2916 times)
benelek

35160983516098 WWW Email
javascript's eval()
« on: Jul 1st, 2003, 3:52am »

in javascript there's eval(String) to turn the contents of the String into an expression. is there an equivalent in java/Processing?
 
flight404

WWW Email
Re: javascript's eval()
« Reply #1 on: Jul 1st, 2003, 10:16pm »

Not exactly sure if I understand you correctly, but you could look into Class.forName() if you are trying to construct an object.
 
v3ga

WWW Email
Re: javascript's eval()
« Reply #2 on: Jul 1st, 2003, 10:42pm »

I don't think there is an equivalent to the Javascript eval function , because Javascript is a scripted language, meaning it is interpreted at run-time whereas Java programs/applets are compiled before being executed .
 

http://v3ga.net
benelek

35160983516098 WWW Email
Re: javascript's eval()
« Reply #3 on: Jul 2nd, 2003, 1:58am »

mm, what i'm looking for is a way to translate a String (eg, "ellipse(5,5,20,15)") into its eqivalent in actual code. the application for it, is code being sent over the new 'net' variable in p5.
 
there are of course ways to get around it (like looking for the word "ellipse" and then using the coordinates immediately following), but it would be simpler if i could just say "eval(String)".
 
Pages: 1 

« Previous topic | Next topic »