Daniel's approach will work.

You might also consider embedding the expression in a C# class and compiling

it using the C# compiler, and loading it in. Somewhere I have an example

that shows both techniques (though not for an arbitrary expression). I don't

think I have it accessible online - email me at

er****@microsoft.com, and

I'll send it to you.

--

Eric Gunnerson

Visit the C# product team at

http://www.csharp.net
Eric's blog is at

http://weblogs.asp.net/ericgu/
This posting is provided "AS IS" with no warranties, and confers no rights.

"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in

message news:Ox****************@TK2MSFTNGP09.phx.gbl...

"philippe mordellet" <an*******@discussions.microsoft.com> wrote in
message news:8A**********************************@microsof t.com... hello everybody,

is it possible to ask the user to write a math function (ie : y = ax +

b) in a textbox, and use this function to plot the curve in a window (how do

Mathematica guys manage this, since its possible in their program ???)

You'll have to write a function parser, basically, which is most certainly

waht mathematica does. I am no master at it, but you should be able to

find some information on google. Look up something like "parsing math
equations" or the like. It shouldn't be terribly complex(assuming you are just doing

basic algebraic equations).

thanks for your kind help,

philippe mordellet -))