|
-
Jan 2nd, 2010, 11:55 PM
#1
Thread Starter
Junior Member
Equation
I know how to read user input using textbox but it only can read character and numbers. Is it possible that I want to read user input equation???
Example:
User type A+B
User put range of A and B.
1.25<A< 3.56
2.45<B< 9.87
I failed to read the equation using textbox. Is it there are other ways that can use to read equation input A+B???
I am using VS2005 and VB.Net. I really new in this programming using VB.Net.
-
Jan 3rd, 2010, 12:00 AM
#2
Re: Equation
You'd have to parse the equation in such a way that you would know what the user could put in. I'm not really sure how that would work, but for the addition..you can just do an If statement to see if there's a "+", if so, split the text on the "+", and take the two numbers (that will come in a String Array), Double.TryParse() them, and then add them up.
-
Jan 3rd, 2010, 12:08 AM
#3
Re: Equation
expressions evaluation is a three-staged process:
1. Parsing and tokenizing (splitting user input into parts called tokens)
2. Converting the expression from Infix into Postfix notation.
3. PostFix Evaluation.
I have my own expression evaluator which understands even some math and sting functions, supports 4 primitive data types including string. But I have abandoned it and didn't implement the support for variables and arrays.
If you're interested in some details - PM me.
-
Jan 3rd, 2010, 10:43 AM
#4
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|