Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing a formula from a text control

Status
Not open for further replies.

hug

Programmer
Mar 14, 1999
46
0
0
VE
Is there any way that I can execute a formula from a variable?<br>
like:<br>
x = 3<br>
y = 7<br>
<br>
formula = "x + y"<br>
<br>
result = formula<br>
<br>
so that result will be = 10 ?<br>
The user would enter the formula on a textbox and the program should execute whatever is on the control.<br>
I use that a lot in Clipper and but now I am stuck!<br>
<br>

 
There used to be an example of a recursive descent parser (which is what you're after) that came with VB3 - probably still on the Microsoft archives somewhere, have a poke around.<br>
<br>
Mike
 
Is there a Eval() function out there tht I can use in VB5?<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top