You can use this code to evaluate mathematical expressions from strings. Make sure to copy the subs and the global variables. It supports */+- and ^.