String object to expression (like "eval" )

Get help using Construct 2

Post » Tue Aug 07, 2012 12:16 pm

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 ?
B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Post » Tue Aug 07, 2012 2:42 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Aug 07, 2012 5:31 pm

Thx for answering my question.
It's save me a lot of time :)

I will try to make a calculator in another way :)
B
24
S
4
G
6
Posts: 13
Reputation: 5,424


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests