Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

getting a value from a string formula [BCB3]

Posted on 2002-04-28
5
Medium Priority
?
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

722 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