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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts

    String to equation

    Simple question!

    I have a text box where I put "2+6*9". How do I get flash to convert this string to a function? So that it gives me the result 56 ??

    I am trying to make a very simple calculator where I can see what I am typing and getting the results.

    Thanks

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Hmm, I've never tried this before. You could pass the string to Google and it would calculate it too.

    I feel like you might have to parse the string in a loop to get each part out of the string. The problem is with the operands, so how complicated might the calculations get?


  •  

    Posting Permissions

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