Does anyone know a way to solve a math expression that a user types in a text box? For example if a user types 3*12/8, or 5*Sin(40) in a text box, Is there a method or routine that produces an answer?
Any help will be appreciated.
A quick search on 'eval' brings several results, including thread222-792530
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?' Essex Steam UK for steam enthusiasts
Add to the components the Script control. Not only it can evaluate expressing such as these mentioned by you, but also these: 3+x/5 where x is a variable and you will assign it a value from a text box
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?' Essex Steam UK for steam enthusiasts
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?' Essex Steam UK for steam enthusiasts
Thank you
I just came across that solution myself.
I set up a test program to learn to use Script control.
I defined some letters, A, B, etc. to represent numbers.
When I enter these letters into a text box by code, Script control doesn't recognize them. Is there a remedy for this?
If you want t use variables build the string using normal concatenation rules:
a = 5
b = 4
Debug.Print Eval(a & "*" & b)
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?' Essex Steam UK for steam enthusiasts
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.