473,402 Members | 2,053 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,402 software developers and data experts.

Dynamically evaluate expressions?

Hi,

Is there any class/method/function in .NET that I can pass a
string containing a math expression (for example, 2 + (22 ^ 6)) and have it
return the value as if I had hardcoded it in the code?
Tales
Nov 20 '05 #1
2 1439
In article <Ou**************@tk2msftngp13.phx.gbl>, Tales Normando wrote:
Hi,

Is there any class/method/function in .NET that I can pass a
string containing a math expression (for example, 2 + (22 ^ 6)) and have it
return the value as if I had hardcoded it in the code?
Tales


Here is one possible solution.

http://www.google.com/groups?q=+%22j...ftngp12&rnum=1

--
Tom Shelton [MVP]
Nov 20 '05 #2
* "Tales Normando" <ta*****@bol.com.br> scripsit:
Is there any class/method/function in .NET that I can pass a
string containing a math expression (for example, 2 + (22 ^ 6)) and have it
return the value as if I had hardcoded it in the code?


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

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

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

Similar topics

7
by: Thomas Gagne | last post by:
I anticipate wanting PHP to evaluate a lot of expressions and would rather not create subprocesses to do it from inside my C program. I've googled around for calling PHP from C, and know Apache...
3
by: Jason luo | last post by:
Hi all, In c99-standard page 52,there is a sentence about void,as below: If an expression of any other type is evaluated as a void expression, its value or designator is discarded. I don't...
13
by: Zeng | last post by:
Hello, Please help!!! I've been stuck on this issue for months. I just wonder if there is a way to programmatically evaluate expression strings such as ( ( 3 + 5 ) / 2 ) > 4 --> this...
2
by: EDom | last post by:
Hi, I have expressions in a string like "100/24*5" and so on. How can I evaluate this expression to get the result. Regards, Vineet
8
by: No Such Luck | last post by:
Is there anyway to literally evaluate the contents of a string in an if statement? For example: int i = 0; char * str = "i == 0"; if(str) /* I know this doesn't do what I want */ {
5
by: Csaba Gabor | last post by:
In Firefox 1.5 (this question is Mozilla specific as I am using greasemonkey) I would like to be able to use document.evaluate to return the first TD entry that shows ^\s*MySearchText\s*$. As I...
5
by: sfeher | last post by:
Hi All, I need to call a function(loaded with appendChild) for which I have the name as a string. .... var fnName = 'fn1'; var call = fnName + '('+ param +' )'; eval(call);
6
by: mstorkamp | last post by:
I need to evaluate simple arithmetic expressions. I wrote a quick and dirty program that allows me to enter dimensions off of a drawing, and based on global or local tolerances calculate an...
2
kadghar
by: kadghar | last post by:
Many people asks if there is a way to write a mathematical expression, writen as a string in a text box, so they can do something like: sub something_click() textbox2.text=eval(textbox1.text)...
7
by: Bala | last post by:
Hi, This is what i am finding out if it is possible. I am not sure but would like to know.. I have a Client application that sends me a condition like this (1 == 'A' && 2 == 'B') || (3 ==...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.