473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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

Jul 21 '05 #1
1 3094

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

Lionel.

"Mad Scientist Jr" <us*************@yahoo.com> a écrit dans le message de
news: 11*********************@z14g2000cwz.googlegroups.c om...
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following...
2
by: Ivan Demkovitch | last post by:
Hi! I'm trying to add script to the page and place following code in my ascx (control): Page.RegisterClientScriptBlock("adder", "<script>function...
0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
10
by: dx | last post by:
I have the Microsoft Press: Developing Microsoft ASP.NET Server Controls and Components book. It's starting to shine some light on control development but there is something about composite...
2
by: Harry Simpson | last post by:
My boss is an ol' Microsoft Script Control 1.0 script guru. So when we needed to calculate fees he wanted to use the Script Control interopted to feed in a script (VBS) along with "objects" and then...
2
by: Peter Rilling | last post by:
Below is some code that I do not know why it does not work. Okay, as you can see it is simple HTML with two ASP:Label controls. Each label has some code that basically gets a string that will be...
1
by: Mad Scientist Jr | last post by:
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...
1
by: Scythen | last post by:
I’m developing script system based on C# script for a game engine. Scripts are written in C# and compiled at run time by a C# class library. The native C++ game code accesses the script compiler...
4
by: Dave Calkins | last post by:
I have a native Win32 C++ app built with Visual Studio 2005. I'd like to make use of a property grid control in this app. For an example of this, in Visual Studio, see the properties control...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.