Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Formula Error

  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Formula Error

    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

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Hi,

    Try this

    Code:
    	Dim text1, text2, text3
    	
    	text1 = 48
    	text2 = 1.2
    	text3 = 2
    	
    	response.write eval(""&text1&" + ("&text2&"*"&text3&")")

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi,
    It work!!!
    Thanks a lot.

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You're welcome...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •