473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Translate a String to a Valid Formula Expression

I develope a program, that need to involve some Math's
formulas, this are specific formulas that the user need
input.

This Formulas was in a string eg. "((A+B)*(A-B))/(1-N)
^2", in this Operation I know the value of all the terms,
but I require know how to convert this string in a valid
expression for evaluate the result.

I'm very gratefull if someone can help me.

FDR
Nov 20 '05 #1
2 1512
Are you familiar with Regex's? If so, you can search for three groups
between ( ) . Not sure however if you need more complex expressions....this
could get to be quite a complex expression. Is there always a divisor for
instance and three expressions? i'm guessing now, but if you tell me the
rules, I'll do the best to write it for you...

HTH,

Bill
"Francisco Dodero" <do*****@yahoo.com> wrote in message
news:04****************************@phx.gbl...
I develope a program, that need to involve some Math's
formulas, this are specific formulas that the user need
input.

This Formulas was in a string eg. "((A+B)*(A-B))/(1-N)
^2", in this Operation I know the value of all the terms,
but I require know how to convert this string in a valid
expression for evaluate the result.

I'm very gratefull if someone can help me.

FDR

Nov 20 '05 #2
* "Francisco Dodero" <do*****@yahoo.com> scripsit:
I develope a program, that need to involve some Math's
formulas, this are specific formulas that the user need
input.

This Formulas was in a string eg. "((A+B)*(A-B))/(1-N)
^2", in this Operation I know the value of all the terms,
but I require know how to convert this string in a valid
expression for evaluate the result.


<http://www.palmbytes.de/content/dotnetlibs/mathlib.htm>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bengt Richter | last post by:
Just thought None as the first argument would be both handy and mnemonic, signifying no translation, but allowing easy expression of deleting characters, e.g., s = s.translate(None,...
5
by: VM | last post by:
If I have a string variable with a formula: string sMyformula = "3.3*5.2*5"; How can I convert this to a mathematical formula that the compiler can calculate? For all purposes, the formula in...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: Wade | last post by:
Hi guys, I am building a string in code that is a mathematical formula, based on a lot of criteria specified by the user. Once the formula is complete, I want to evaluate it to get a result. ...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
3
by: Mehmet Baserdem | last post by:
Hi all, I am trying to remove all blank chars in middle of the string "text1 text2 text3 text3 text4" with following stmt: VALUES(translate('text1 text2 text3 text3 text4' ...
2
by: Amy L | last post by:
It looks as if there is no equivalent .Net regular expression method that is comparable to tr/// (Translate) in Perl. I was looking to squash a specific duplicate character in a string. In...
3
by: amija0311 | last post by:
Hi, I am new using DB2 9.1 database by windows base. I want to query the data that contain string then translate the string into integer using DB2. The problems is If the data is null, i got the...
3
by: eBob.com | last post by:
Is there a regex pattern which will match a VB.Net string? I.E. a regex which matches ... "this is a ""vb.net"" string" (I don't want three matches in this case, I want one.) I've come up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.