# reading an equation from an edit box?

How can i make the program itself understand an equation that i write into an edit box ,  for example , i would write 4x^3 + 2x^2 -x +2 ,
the computer would just see it as the string ' 4x^3 + 2x^2 -x +2' , but i want it to be able to read it 4*(x*x*x)+2*(x*x)-(x)+2 where the x would be a declered variable in the program , is there a way to do this without 1000 if loops or should i just build the program with dozenz if listboxes to make my life more easier , but the program less user friendly.
When and if i´m able to do this , i´m going to make the computer draw graphs in a given domain , and hopefully also calculate the area between two graphs , but it kinda all lies on that damn edit compenent , can someone out there please help me , this is for my final project in a programming course, and i am getting really tired of this .......
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Take a look at xaeval.zip
from DSP (http://sunsite.icm.edu.pl/delphi).

Go to the search engine and type it in (the URL it gices me doesn't copy and paste properly.

Cheers,

Raymond.

0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
Also look at these ones from the same location:

parsers1.zip: "TFunctionParser and TComplexParser parse mathematical functions and evaluate them. About 80 real and 30 complex predefined functions and operations available! Constants, functions and variables can be defined by the user! "

parser10.zip: "TParser - parsing and evaluating mathematical expressions specified at runtime. Only about 40% slower than the equivalent compiled expression"

exprev10.zip: "A mathematical function parser that allows you to calculate a value given an expression in string form. Supports: +, -, *, /, ^, (, ), ABS, ATAN, COS, EXP, LN, ROUND, SIN, SQRT, SQR, TRUNC, and unlimited number of user-defined variables"

Cheers,

Raymond.

0
Author Commented:
Thanx Raymond ,

but there is a little problem , although i don´t doubt that these components work , the url for xaeval.zip  is invalid , and the search engine on the delphi super page is bogus , and when i search for parser1.zip it give me everything except that file , so if you could tell me were i could get these files elsewhere i would be very greatful....

Hafsteinn.
0
Commented:

Cheers,

Raymond.
0
Author Commented:
thanx
Raymond

my e-mail is hafhalf@fas.is

Hafsteinn.
0
Commented:
I have sent them to youe email address above.

Cheers,

Raymond.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.