Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to construct a formula based on user's input?

how to construct a formula based on user's input?

Scheduled Pinned Locked Moved C#
questiontutorialdiscussion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michal kreslik
    wrote on last edited by
    #1

    Hello, how do I construct a mathematical formula based on user's TEXT input? It would be too complicated to explain what do I need to accomplish in my app, but let's just say that there's a textbox on a user form and based on what the user enters into that textbox, further calculation will be done. E.g. if user enters "a + ( b / 2 )" and "a" and "b" will be recognized/parsed as valid variables with some internal meaning, the app will do certain calculation based on this formula. It would be too cumbersome to try to catch all possible input combinations the user might possible enter. There must be some standard way on how to do this. Is there any best practice on how to do this? Thank you very much for any input, Michal Kreslik

    L 1 Reply Last reply
    0
    • M michal kreslik

      Hello, how do I construct a mathematical formula based on user's TEXT input? It would be too complicated to explain what do I need to accomplish in my app, but let's just say that there's a textbox on a user form and based on what the user enters into that textbox, further calculation will be done. E.g. if user enters "a + ( b / 2 )" and "a" and "b" will be recognized/parsed as valid variables with some internal meaning, the app will do certain calculation based on this formula. It would be too cumbersome to try to catch all possible input combinations the user might possible enter. There must be some standard way on how to do this. Is there any best practice on how to do this? Thank you very much for any input, Michal Kreslik

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      There have been several articles on CP about this. Search keywords could be: symbolic, expression, evaluation :)

      Luc Pattyn

      M 1 Reply Last reply
      0
      • L Luc Pattyn

        There have been several articles on CP about this. Search keywords could be: symbolic, expression, evaluation :)

        Luc Pattyn

        M Offline
        M Offline
        michal kreslik
        wrote on last edited by
        #3

        Thank you very much, you helped me a lot by placing a correct name on the issue. Thanks, Michal

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups