Subscribe to Windows IT Pro
January 25, 2006 12:00 AM

Take advantage of a precious JScript functionality in .Net Runtime

Dev Pro
InstantDoc ID #124870
Rating: (0)
JScript and .Net languages potentials cannot obviuosly be compared. But there's at least one thing JScript have while VB.Net and C# have not: the Eval() funxtion. Eval is able to evaluate complex expressions like '(((a > 0) and (b < 2)) or c != 0)' or other event more complex. Neither C# and VB.Net are able to evaluate this kind of expression in a single statement, you have to manually parse the expression and evaluate it by considering a single condition at time. But what you can do is make the JScript Eval function available in the .Net Runtime by compiling at runtime some JScript code and exposing this compiled code as a class method. See my example.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.