
-----------------------------------
Sceyef
Sat Dec 27, 2014 1:00 pm

How to Limit a String? for a calculator
-----------------------------------
I am making a calculator. It's the basic Windows Calculator. With +-*/

so like, calculators have limits to how large numbers can be in terms of length

how do i make that limit?

I use Draw.Font to show the calculator's screen. GUI buttons run a procedure to add a character to the string in Draw.Font, for example clicking button with 2 will add "2".

-----------------------------------
Insectoid
Sun Dec 28, 2014 1:08 am

RE:How to Limit a String? for a calculator
-----------------------------------
You're going to have to get the length of the string. You don't need any special commands to do this (an integer that increments every time a number button is pushed will work) but you can use the [url=http://compsci.ca/holtsoft/doc/length.html]Length() function as well.

Now that you can get the length, you can figure out how to stop the buttons from working if the string is too long.

-----------------------------------
Sceyef
Sun Dec 28, 2014 4:19 pm

RE:How to Limit a String? for a calculator
-----------------------------------
Thanks a lot.
