|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
EVAL functionIn 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" <bel***@datamti.com> schrieb: Hand-made:> 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 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> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> bill wrote:
> In VB.NET 2005, is there an equivalent of the EVAL function available in Bill here is a possible solution:> 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 http://groups.google.com/group/microsoft.public.dotnet.languages.vb/msg/cdd5d864296563a7?q=+%22jscript%22+group:microsoft.public.dotnet.languages.*+author:Tom+author: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 :) -- Tom Shelton [MVP]
Image Upload problem - tearing hair out here!!
Books: (I'm converting vb release 4 to release 8) But will eventually move it to other PCs simple OO question Generating Reports Using VB.net Writing and reading from a template Excel file using ADO.Net - results not recalculated Red Semaphore. Ideas? minimizing viewstate Managed DX - 'DrawText' ambiguous Translating VB6 Code to kill the screen saver. Using a User's Control of VB.NET in a Form of VB6 |
|||||||||||||||||||||||