EVAL function

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

In VB.NET 2005, is there an equivalent of the EVAL function available in
MSAccess and javascript?

I need a way to pass a dynamically generated string (like "2+2") to a
function and return 4.

EVAL("2+2") will return 4

Thanks
Bill
 
bill said:
In VB.NET 2005, is there an equivalent of the EVAL function available in
MSAccess and javascript?

I need a way to pass a dynamically generated string (like "2+2") to a
function and return 4.

EVAL("2+2") will return 4

Hand-made:

MathLib
<URL:http://www.palmbytes.de/content/dotnet/mathlib.htm>

Dynamic compilation:

Build a Custom .NET "EVAL" Provider
<URL:http://www.eggheadcafe.com/articles/20030908.asp>

Runtime Compilation (A .NET eval statement)
<URL:http://www.codeproject.com/dotnet/evaluator.asp>

Evaluation of numeric expressions using J#:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.csharp/msg/9e95759b54a323a7>
 
bill said:
In VB.NET 2005, is there an equivalent of the EVAL function available in
MSAccess and javascript?

I need a way to pass a dynamically generated string (like "2+2") to a
function and return 4.

EVAL("2+2") will return 4

Thanks
Bill

Bill here is a possible solution:

http://groups.google.com/group/micr...or:Shelton&hl=en&lr=&ie=UTF-8&oe=UTF-8&rnum=1

This was a very simple example... Please be aware that this will allow
you to run arbitray bits of JScript code - so you might want to put
some kind of verification on the actual expresions passed. You could
probably use a regex to make sure that the expression was really not
code :)
 
Back
Top