| Author: Stephen M 18 Jul 2007 | Member Level: Bronze Points : 0 |
I have a feeling this has more to do with my compiler, but both the ASP.NET v1.1 and v2.0 compilers won't compile the JScript:
c:\JPackage.js(3,7) : error JS1004: Expected ';' c:\JPackage.js(10,1) : error JS1002: Syntax error c:\JPackage.js(4,1) : error JS1234: Only type and package definitions are allowed inside a library
This is exactly what I need and is a perfect quick solution for what I need. So I hope you can help me determine my compilation issue!
|
| Author: Stephen M 18 Jul 2007 | Member Level: Bronze Points : 0 |
OK ... I figured it out ... simple as I expected
The class declaration must be "class" with a lower case 'c' ... I simply did a cut & paste and without any prior JScript knowledge it didn't jump out at me right away.
Anyway ... this is here for anyone else who needs this solution!
|
| Author: Joe 13 Jul 2009 | Member Level: Bronze Points : 2 |
I modified the code a little because the new vb.net requires strongly named binaries. Also this now supports advanced math including trig and exponential functions
import System.Reflection [assembly:AssemblyKeyFile("C:\\mpkey.snk")] [assembly:AssemblyVersion("1.0.0.1")] package JPackage { class JClass { function Evaluate(strExp : String) : String { with(Math) { return eval(strExp); } } } }
|
| Author: R.Jaya kumar (JK) 15 Jul 2009 | Member Level: Diamond Points : 0 |
error comes here check this jpg file
 |