From: John L. <jla...@gm...> - 2013-08-16 21:53:03
|
On Fri, Aug 16, 2013 at 3:21 PM, Milind Gupta <mil...@gm...>wrote: > Hi, > I am trying to find out if there is an easy way I can add > mathematical equation writing support to my page. I have never done this > before so any pointers would be helpful. Can I use any existing library > with wxlua to achieve this? Or would it be easier to make it from scratch. > > I have used this library before and it works as advertised : http://warp.povusers.org/FunctionParser/ However, a pure Lua solution is probably what you want and I have not attempted to do that either. I would think that if you get a string from a user then run it through some checks to make sure it doesn't have 'if', 'for', 'os.execute', or any other nastyness, prepend "return" to it then use pcall() to run it that should work. The hard part is getting all the check rights so you don't have any security holes and the user can't crash/lock-up your program. Regards, John ps. I'll check the controls later tonight when I can get to a MS Win machine and respond in your other thread. |