CodeDom example

  • Thread starter Thread starter Marco Trapanese
  • Start date Start date
M

Marco Trapanese

Hi!

In my program the user may write a math function into a textbox, for
example:

sqrt(sin(A*3))^cos(B+5)

where A and B are 'tags' for other textboxes (I replace A and B with
csng(text1.text) and csng(text2.text)). I need to evaluate it at
run-time. I guess I might use the CodeDom class.

I tried this code:

http://www.microsoft.com/italy/msdn/risorsemsdn/community/tips/0612.mspx

(the comments are in Italian)

and it works fine but I can't use variable or controls already present
in my project.

Could anyone provide me a simple example to achieve that?

Thank you
Marco / iw2nzm
 
Marco said:
Hi!

In my program the user may write a math function into a textbox, for
example:

sqrt(sin(A*3))^cos(B+5)


Well, I found this parser:

http://tinyurl.com/2pw8xy


A user says:

"I enjoyed the expression evaluator very much!
I compared it to my own CODEDOM-Evaluator and
the speed of mccalc is about 10 to 1000 times faster!!"

Why a parser written in highlevel language may result faster than a
native one (CodeDom)?

Marco / iw2nzm
 
Back
Top