I have a calculator program that takes a string entered into a text field,
runs it through a syntax screening function and then executes the
string via eval(), which I told I should never use.
So the problem is how do I convert a string representing an arithmetic
operation to executable code without using eval? (hopefully without
another 50 -100 lines of code)
Code:// screen code... assuming success.. sample = '3*(42/9.8)'; // for instance return eval(sample) // change to ????