Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to evaluate a formula string

Status
Not open for further replies.

anurc

Programmer
Jul 11, 2002
18
US
I have a formula as string. How to evaluate it using vb.net?
eg. I have (10.2+30+10) as a string variable
how can i get a sum of this (evaluate this formula) as 50.2

Thanks
 
Two ways that I know of
1. Use Regular Expressions. Francesco Balena has an example of this method in his book Programming Visual Basic .net, but I can't find a reference on the web

2. Use the Microsoft Scripting Control
This is much easier and there is an example I found - here you go


Hope this helps

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top