38 posts
Posted 04 March 2012 - 02:39 AM
I was wondering if there was a way to limit the maximum number of letters or numbers in an input?
496 posts
Location
Harlem, NY
Posted 04 March 2012 - 02:40 AM
Yes, there is a way. How? but you didn't ask that. :unsure:/>/>
38 posts
Posted 04 March 2012 - 02:43 AM
Yes, there is a way. How? but you didn't ask that. :unsure:/>/>
Um, how o.o
715 posts
Posted 04 March 2012 - 03:11 AM
Do you mean to limit it live, i.e. while data is being typed in by the user?
If you do mean that, then you'd have to create your own read() function.
You don't have to invent the wheel though and could take the read() function defined in the "bios.lua" as a template.
Then you modify its event loop so that every time a character is entered you make certain extra checks to see if any of your input rules (max number of letters/numbers) are met.
For starters I'd suggest to take a look at the read() function and try to understand how it works.
Then copy it, play around a bit with its code and then build up to what you want to achieve step by step.
You can do it, and you'll definitely learn a lot from it. :unsure:/>/>