Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

getting a value from a string formula [BCB3]

Posted on 2002-04-28
5
Medium Priority
?
228 Views
Last Modified: 2010-08-05
Is there a way to take a AnsiString like:

AnsiString formula;
formula = "(4*5)+(12/3)";

and changing that formula to a float value without parsing the string.

For instance I'm using a TEdit control the user is inputing a formula or just a chain of like: 1+2/3

Thanks





0
Comment
Question by:wolfpackinc
5 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6976888
Not using standard C++.
0
 
LVL 3

Accepted Solution

by:
jtm111 earned 400 total points
ID: 6977300
You should use a commercial math interpreter library or component. A good place to start looking is here:

http://www.mathtools.net/C++/Interpreters/
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 6978435
or write your own parser to do the job
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 6978439
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7036270
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question