Article Preview
Buy Now
FEATURE
Numbers Please! Part 6
A Numbers-Only Field...
Issue: 18.1 (January/February 2020)
Author: Markus Winter
Author Bio: Markus is a Molecular Biologist who taught himself REALbasic programming in 2003 to let the computer deal with some exceedingly tedious lab tasks. Some call it lazy, he thinks it smart. He still thinks of himself as an advanced beginner at best.
Article Description: No description available.
Article Length (in bytes): 27,549
Starting Page Number: 12
Article Number: 18102
Resource File(s):
project18102.zip Updated: 2020-01-02 13:07:44
Related Link(s): None
Excerpt of article text...
Quite a few people had expressed interest in downloading this
NumbersOnlyField
project. As they were patient with me (and they have been good this year), it seems appropriate that they'll finally get their hands on it as we enter the "festive season."I have to admit that I did not expect this article series to go on for such a long time (and neither did my editor), so I'd like to thank everyone for their patience, and I hope you'll find this little New Year's "present" useful.
But as with any gift, we still need to wrap it up. So let's get to it.
There are a lot of things that I won't mention (like integrating the TextField with a warning sign) as that might result in another six articles, but here is a little overview of how it works for now (and you should be able to work out the rest from the source code). Just keep in mind that there are two goals to be achieved: one is to create a RegEx pattern that can tell us if a text input is a valid number, and the other one is to prevent the user from entering invalid input. Note that it is not strictly necessary to prevent the user from entering invalid input as you could just refuse to continue in your app as long as an entry is not valid.
The
NumbersOnlyField
class
- is called
cNumbersOnlyField
and hasTextField as a Super
class.
...End of Excerpt. Please purchase the magazine to read the full article.