...

View Full Version : Formula Error



Sky86
12-14-2007, 01: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?
Thanks

Whatever Jr.
12-14-2007, 08:10 AM
Hi,

Try this



Dim text1, text2, text3

text1 = 48
text2 = 1.2
text3 = 2

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

Sky86
12-14-2007, 08:16 AM
Hi,
It work!!!
Thanks a lot.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum