var formulaValue = document.getElementById("txtBoxA").value;
var index = calculator.getEngine().getErrorStrings().indexOf(formulaValue.toString());
var index2 = calculator.getEngine().formulaErrorStrings.indexOf(formulaValue.toString());
if (index > -1)
window.alert("Enter the valid parameters");
else if(index2 > -1)
window.alert("Enter the valid formula"); |
Hello,
Thank you for the example and sample link. However, it is not fully working. For example, when a formula "SQRT(1 + ad2 )" is used, i got the error message "TypeError: args.split is not a function" and this error is not actually caught (index and index2 is -1).
I wonder if calcQuick(ejCalculate) can be configured to throw exception in case of any error (instead of checking the calculated value against several error lists as you suggested in your example).
Thanks!
Hui