Gettext with numbers

Greetings. It has been literally years since I visited or asked a question but we’re still using Panorama for crucial tasks at work. My question is, I hope, simple: is there a way to modify gettext so that the user can enter a number instead of text and have it pass on through the procedure as a numeric value?


No, but there is nothing to stop the procedure from doing something like

theVariable = val(theVariable)

after the gettext. From that point on, theVariable will contain a number.

So easy and just what I needed. Thanks!!

Not to be a Cassandra, but it’s never “that simple” when it comes to user interfaces.
If this routine is for you, and only you, and you remember to always put in text that can become a legitimate number, you’ll be fine.

But if this is for someone else, and you think they will always put in the expected content, you might be surprised. At least, these days, we can bracket such expectations with Try … Catch.

As my first programming instructor said - this might be dating things a bit - “I want your program to be so robust it will run if they put the card deck in upside down.” As with a Zen Koan, it wasn’t the finger that was important; it was what the finger was pointing to.