Re: Storing Formulas - Database
- From: "Homer J Simpson" <nobody@xxxxxxxxxxx>
- Date: Sat, 04 Mar 2006 06:25:18 GMT
"Brian P. Hammer" <BrianHammer@xxxxxxxxxxxxxxxx> wrote in message
news:%23OyFyizPGHA.3272@xxxxxxxxxxxxxxxxxxxxxxx
All - I have a project that has a bunch of formulas. I would like to
store each of the formulas in a SQL and then load them and have my app
execute it. The problem I see is that a Dataset would return the formula
as a string and not as a result. Anyone have an idea on how I could
accomplish this?
Example: If I wanted to store ((5+15)-9)*10 in SQL. I want to display the
answer 111 in a text box and not ((5+15)-9)*10
What you need is an EXEC function - a function which can treat a string as a
line of code and compute it. You could write your own interpreter but you
will not enjoy that - see "The dragon book" (Compilers: Principles,
Techniques and Tools by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman) if you
don't believe me. You may find it easier to use an Excel spread*** to do
this. Another approach is a parser subroutine - see
http://www.codeproject.com/cpp/FastMathParser.asp which might work OK.
.
- References:
- Storing Formulas - Database
- From: Brian P. Hammer
- Storing Formulas - Database
- Prev by Date: Re: password set up
- Next by Date: Problem using ssl with webservice.htc, Help needed
- Previous by thread: Storing Formulas - Database
- Next by thread: Re: Program running in administrator and guest account
- Index(es):