Jump to content

Recommended Posts

Posted

I have to write a small program for a class, and ultimately what I need it to do is to evaluate a user's function at certain values. The functions won't be terribly complex. For example, I want an InputBox to pop up, and the user would input, say, "3(x^2)-4x+6". Then my program would evaluate it at certain values (x=0, x=1, x=2, etc) and do something with the results.

Is there an easy way to have the user input a string and have autoit convert it into a function that can be evaluated?

Posted (edited)

http://www.codeproject.com/KB/recipes/MathieuMathParser.aspx

This may be of interest to you. It's more robust and would be better in the long run to write a parser rather than rely on AutoIt's dynamic execution functions.

Edited by Richard Robertson

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...