[comp.lang.pascal] string evaluation

hp0p+@andrew.cmu.edu (Hokkun Pang) (02/18/89)

Hi everyone,
  I need help. I need a function for evaluating algebriac functions stored
as a string expression. I want something like this:

   function value_of_expression( expression : string; x : real) : real

so if I have:
   value_of_expression('x^2+sin(x)',pi)
I should get 3.14^2+0 which is roughtly 9.8

Since the function will be used extensively in the program, the function must
be fast. If you have the actual codes, algorithm or ideas about the function,
please tell me. Thanks. Also, I use Turbo 5.0