Reputation: 54123
I'm trying to build a scientific calculator with vb .net, except it is vista glass :-p
I basically want the user to be able to enter an equation like SQRT(5 * 6) / (2 ^ 4) and then I want vb to use system.math to solve it. If I write this in my code, vb is able to do it, so how could I do this at runtime.
Thanks
Upvotes: 1
Views: 2865
Reputation: 15813
There is not a simple way to do this. You can write a parser to handle the general expressions and functions (the most fun), or you can make a call to excel or an equivalent program that handles expressions.
Upvotes: 0
Reputation: 30398
Microsoft have already done this (in Windows 7).
(I realize you're just doing this for fun and probably don't care.)
Upvotes: 0
Reputation: 26426
Somebody's already done this (including source code):
http://community.bartdesmet.net/blogs/bart/archive/2006/10/11/4513.aspx
Upvotes: 1