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 .......
hafhalfAsked:
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.

rwilson032697Commented:
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

Your issues matter to us.

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

Start your 7-day free trial
rwilson032697Commented:
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
hafhalfAuthor 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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

rwilson032697Commented:
I'm sorry you have had problems. Give me your email address and I will download and email them to you - can't say fairer than that :-)

Cheers,

Raymond.
0
hafhalfAuthor Commented:
thanx
Raymond

my e-mail is hafhalf@fas.is

Hafsteinn.
0
rwilson032697Commented:
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.