views:

340

answers:

4

Hello

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

+1  A: 

Take a look at this tutorial on dynamically executing code.

JoshJordan
+1  A: 

Somebody's already done this (including source code):

http://community.bartdesmet.net/blogs/bart/archive/2006/10/11/4513.aspx

Keltex
A: 
MarkJ
A: 

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.

xpda