Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 18.1 ('SceneKit')
Instant purchase and download via GumRoad!


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):

Download Icon 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 has TextField as a Super class.

...End of Excerpt. Please purchase the magazine to read the full article.