[quote=“nick_sherman,post:2,topic:150993”]
You need to add to your string rather than replace it.
TextBox = TextBox.."1"
As for calculations, you need to sit down and first think in plain English terms (or your own language!) what a calculator needs to do. Only then can you convert that to code. For example:
You press 2 and then 3, it displays 23. So for this you need string concatenation (as above).
You press 2 and then ‘+’, and then 3, the 2 will disappear but the program needs to remember this so it can use it in the next calculation. So for this you need a variable to store the original number, and a variable to store what the next operation will be, i.e. ‘+’.
If you now press ‘=’, it takes the original number and the current number on screen, converts them to numbers - using tonumber - and depending on what operation was selected performs that calculation, and puts that result back on screen.
As you can see a calculator may seem simple but without knowing the basics of programming and lua it can get quite complex. Have you worked through any Corona examples or tutorial videos and understood them? Have you been through the api to get a feel for what sort of commands are available?
We have seen a lot of people on these forums trying to run before they can walk and getting very frustrated because they are essentially trying to build a house without first knowing how lay bricks. [/quote]
tysm i’ll try tomorrow