I have defined some function say cosinus(). In other routines I have strings with the text that have some math functions and my special math function cosinus(x). Is it possible to convert text string "cosinus(x)" into a function call and that function cosinus() already has been defined before. Or at least assigning function to a variable. I know that pascal has a library called symbolic.
see example code below,This works fine. But as you can see, this method does not allow array of x nor constant Pi because its library will generate execution error. Therefore I have to start from scratch. :o
uses symbol; var s :real; s:='cos(3.14159265359*45/180)'; writeln(quickevaluate(s,[],[]));
But as you can see, this method does not allow array of x nor constant Pi because its library will generate execution error.
This works fine. But as you can see, this method does not allow array of x nor constant Pi because its library will generate execution error. Therefore I have to start from scratch. :o
writeln(quickevaluate(s,['pi'],[pivalueasdouble]));