eval() works correctly on Android not on Iphone
Hi,
I face a strange problem.
This works on Android NOT on Iphone:
result = String(eval(HTValue));
HTLabel.text = result;
where HTValue = '12+3' for example.
But this works on Android AND Iphone :
result = String(eval('12+3'));
HTLabel.text = result;
Did I miss something ?
Thanks for your help.
1 Answer
-
I found a solution. But don't understand why it works.
Here is what I've found :To make it work under Iphone + Android, just add a semicolon to the eval string like this :
result = String(eval('12+3;')); HTLabel.text = result;