Special

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 17.6 ('Xojo in Cologne')
Instant purchase and download via GumRoad!

FEATURE

Numbers Please! Part 5

A numbers-only field

Issue: 17.6 (November/December 2019)
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: graphicbox> Article Length (in bytes): 20,892
Starting Page Number: cy
Article Number: 17602
Related Link(s): None

Excerpt of article text...

In our continuing quest to build a proper numbers-only field, in this issue we will implement the RegEx for dec, prec, and exp that potentially form part of a "common number." Things should be rather straight-forward as we already did most of the heavy lifting when dealing with the integer part of a number and will be able to re-use quite a bit of what we did there. So let's get straight into it... after a small interlude.

A small change and a simplification before we begin.

As the boolean UseGroupingForFourDigitNumbers is not particularily well named (Does it mean you group four digits together or do you group four digits into groups of three?) I have renamed it to KeepFourDigitIntegersTogether and adjusted the code accordingly (by swapping the code in the if...then and else sections).

For dec we had also stated that

  • The international standard is that you cannot omit the zero when the number is between +1 and -1. We could, however, allow entry without a zero as in ".07" and convert it to "0.07" automatically.

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