Page 1 of 1

String object to expression (like "eval" )

PostPosted: Tue Aug 07, 2012 12:16 pm
by hayato
Can a string object change to a expression and get the result?
For example a string "1+2+3" make someway to a result "6".

I want to make a calculator like "calc" in windows.
Have those features:
1.Show input expression on the screen in text object.
2.Can add & delete a word ("0~9" or "+-*/") of the end of expression anytime.
3.When press "=" button , get the result of the expression.

So can I make the string to expression like "eval" dose ?

Re: String object to expression (like "eval" )

PostPosted: Tue Aug 07, 2012 2:42 pm
by Ashley
This can't (and arguably shouldn't) be supported for a number of reasons, but it's possible to implement a calculator without it anyway.

Re: String object to expression (like "eval" )

PostPosted: Tue Aug 07, 2012 5:31 pm
by hayato
Thx for answering my question.
It's save me a lot of time :)

I will try to make a calculator in another way :)