Hi Klaus,
|| I have a string that says "2*2" ...
|| (which my sharp brain tells me should be somewhere around 4) ;)
You know, I think you're right! Have you ever thought of going into
programming? I think you'd be good at it. ;-)
Here's one implementation of an arithmetic evaluator class.
http://www.palmbytes.de/content/dotnetlibs/mathlib.htm
The site is in German but the Download link is obvious and everything's in
English in
the zip file.The app is about showing a graph based on user-defined equations.
Have a dig around inside the evaluator. You'll probably have to do a bit of
work getting your calculator variables set up, ditto additional functions.
Then you're off!
If you want full-on calculation - anything that VB.NET can calculate - you
might like to explore the VSA Namespace. This is the realm of the scripting
engine and can handle some powerful code. Naturally it's a lot more effort to
get going. There is a newsgroup just for this topic:
microsoft.public.dotnet.vsa, though it's not hugely busy.
Another option you could explore is dynamic compilation. I haven't looked
at that myself, so my paragraph runs out here.
Out of interest, could you post some examples of the expressions that
you'd like to evaluate?
Have fun. ;-)
Regards,
Fergus