native .NET equivalent of Microsoft Script Control ?

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
 
A

Aquila Deus

Mad said:
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

JScript.NET?
 
M

Mad Scientist Jr

Is it true that VSA is obsolete?
If so, what replaces it for scripting support in .NET?


Phil said:
There's this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting06112001.asp

but I seem to recall that those scripting engines were not supported or were
deprecated in the 1.1 framework, or similar language that I can't remember
the details of.
--
Phil Wilson
[Microsoft MVP-Windows Installer]

Mad Scientist Jr said:
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





-----


Dmitry Medvedev Feb 13, 1:31 am show options


Newsgroups: microsoft.public.dotnet.scripting
From: "Dmitry Medvedev" <[email protected]> - Find messages by this
author
Date: Sun, 13 Feb 2005 11:31:36 +0200
Local: Sun, Feb 13 2005 1:31 am
Subject: Re: native .NET Microsoft Script Control ? (particularly eval
method)
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse


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-us/dnclinic/html/scripting061120...



http://www.csharphelp.com/archives/archive102.html
http://www.qwhale.net/products/scripter/


Regards,
Dmitry


bruce barker Feb 14, 9:05 am show options


Newsgroups: microsoft.public.dotnet.scripting
From: "bruce barker" <[email protected]> - Find messages by this

author
Date: Mon, 14 Feb 2005 09:05:51 -0800
Local: Mon, Feb 14 2005 9:05 am
Subject: Re: native .NET Microsoft Script Control ? (particularly eval
method)
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse


VSA is no longer a recommended technology. Its marked obsolete in
version
2.0


-- bruce (sqlwork.com)
 

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