![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
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 |
#2
| |||
| |||
|
|
Hello, You can use VSA technology to have native support for VB.NET and JScript.NET in .NET applications. have a look to the following urls: http://msdn.microsoft.com/library/en...ng06112001.asp http://www.csharphelp.com/archives/archive102.html http://www.qwhale.net/products/scripter/ Regards, Dmitry "Mad Scientist Jr" <usenet_daughter (AT) yahoo (DOT) com> wrote in message news:1108228983.598538.283610 (AT) f14g2000cwb (DOT) googlegroups.com... 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 |
#3
| |||
| |||
|
|
Thanks for your reply. What replaces VSA? How can you do jscript or vbscript evaluation in your .NET apps without compiling on the fly? Isn't that a bit kludgey? bruce barker wrote: VSA is no longer a recommended technology. Its marked obsolete in version 2.0 |
#4
| |||
| |||
|
|
Thanks for your reply. What replaces VSA? How can you do jscript or vbscript evaluation in your .NET apps without compiling on the fly? Isn't that a bit kludgey? bruce barker wrote: VSA is no longer a recommended technology. Its marked obsolete in version 2.0 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |