native .NET Microsoft Script Control ? (especially the Eval method)

M

Mad Scientist Jr

Is there a native .NET equivalent of the Microsoft Script Control,
particularly the Eval method? See here:

http://www.devx.com/vb2themax/Tip/18773

It works great - it even compares string expressions. I just would
prefer a native .NET version over COM if at all possible.

Sample code:

Dim scriptControl1 As New MSScriptControl.ScriptControl
Dim sExp As String
scriptControl1.Language = "VBScript"
Textbox1.Text = ""
sExp = "12 + 3 * 10"
Textbox1.Text += sExp & " = " & scriptControl1.Eval(sExp) & vbCrLf
sExp = "(`abba` < `bagel`)"
sExp = Replace(sExp, "`", Chr(34))
Textbox1.Text += sExp & " = " & scriptControl1.Eval(sExp) & vbCrLf
sExp = "(`red` < `bagel`)"
sExp = Replace(sExp, "`", Chr(34))
Textbox1.Text += sExp & " = " & scriptControl1.Eval(sExp) & vbCrLf
sExp = "((1*5)*5)"
sExp = Replace(sExp, "`", Chr(34))
Textbox1.Text += sExp & " = " & scriptControl1.Eval(sExp) & vbCrLf
sExp = "( (`abba` < `bagel`) and true) or ( ((1*5)*5) = 25 ) "
sExp = Replace(sExp, "`", Chr(34))
Textbox1.Text += sExp & " = " & scriptControl1.Eval(sExp) & vbCrLf
 
L

Lionel LASKE

Please avoid multi-post in newsgroup, use cross-post.
See my anwser in microsoft.public.dotnet.framework newsgroup.

Lionel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top