View Full Version : Formula Error

12-14-2007, 02:54 AM
Hi All,
i have facing some problem working with the formula.
i creating a tool (calculator), this tool require a database to store formula insert by the user.

the problem i facing now is, the user insert the formula the i can store into the database, but when i call out it become a string. computer can't generate the string(formula).

i have 3 textbox, i name it text1, text2, and text3. User can insert the formula into the the formula textbox. e.g "text1 + (text2*text3)". i can store the formula into the database. but i can't generate it when i call out the formula.

Can someone help me with this?

Whatever Jr.
12-14-2007, 09:10 AM

Try this

Dim text1, text2, text3

text1 = 48
text2 = 1.2
text3 = 2

response.write eval(""&text1&" + ("&text2&"*"&text3&")")

12-14-2007, 09:16 AM
It work!!!
Thanks a lot.

Whatever Jr.
12-14-2007, 09:19 AM
You're welcome...