|
Author |
Topic: javascript's eval() (Read 2916 times) |
|
benelek
|
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
|
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
|
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
|
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)".
|
|
|
|
|