Thread: String Parsing
View Single Post
  #24  
Old 03-22-2008, 06:33 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tolnaftate2004 View Post
Attached is a script for eval() for doing math. It can handle almost any gscript operator right now ('new' and ?: I have omitted, and 'in' because this does not yet support arrays for all I know). It recognizes this. variables in a very elementary way. Strings, GUI objects/TStaticVar/etc, and functions are not supported at this time.

I would perhaps make this a class and join it to a static variable.
PHP Code:
echo(this.eval("((2&&3)+(this.f=97.3))")); // 98.3
echo(this.f);                              // 97.3 
Awesome.
__________________
Reply With Quote