CodeDom example

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Trapanese

    #1

    CodeDom example


    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/...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 Trapanese

    #2
    Re: CodeDom example

    Marco Trapanese wrote:
    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

    Comment

    Working...