HighTechTalks DotNet Forums  

Re: native .NET Microsoft Script Control ? (particularly eval method)

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss Re: native .NET Microsoft Script Control ? (particularly eval method) in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dmitry Medvedev
 
Posts: n/a

Default Re: native .NET Microsoft Script Control ? (particularly eval method) - 02-13-2005 , 04:31 AM






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

Quote:
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




Reply With Quote
  #2  
Old   
bruce barker
 
Posts: n/a

Default Re: native .NET Microsoft Script Control ? (particularly eval method) - 02-14-2005 , 12:05 PM






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

-- bruce (sqlwork.com)


"Dmitry Medvedev" <medvedev (AT) qwhale (DOT) net> wrote

Quote:
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






Reply With Quote
  #3  
Old   
bruce barker
 
Posts: n/a

Default Re: native .NET Microsoft Script Control ? (particularly eval method) - 02-28-2005 , 04:00 PM



there currently is no replacement or offical roadmap.

-- bruce (sqlwork.com)


"Mad Scientist Jr" <usenet_daughter (AT) yahoo (DOT) com> wrote

Quote:
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




Reply With Quote
  #4  
Old   
Stefan Simek
 
Posts: n/a

Default Re: native .NET Microsoft Script Control ? (particularly eval method) - 03-01-2005 , 09:31 AM



Hi,

Some time ago I was playing with the JScript.NET engine to execute code
without compiling it first, but I don't remember how it was exactly. It
had something to do with setting the "il" option of the VsaItem in
question to false, but I don't have the full code at hand.

HTH,
Stefan

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



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.