check field for letters

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: check field for letters

Post by jacque » Thu Oct 30, 2014 7:21 pm

Maybe what you want then is "exit closeField". Putting a break command in there is basically causing an abort, which the exit command does cleanly.

But I think dynamic keydown checks would be much easier on both the user and the script. Corrective dialogs are frowned on these days and are considered unnecessarily intrusive. With a keydown handler the user knows immediately something needs to be corrected. Rather than warning, beeping, or anything else, I'd just trap any disallowed keys and do nothing. The user will see immediately that those keys don't produce any text and will substitute something else. This is an elegant way to get correct input without throwing a distraction into the mix and requiring the user to dismiss a dialog. it basically prevents errors rather than allowing them and then requiring the user to go back and fix them. It also wouldn't interfere with your field navigation.

Is there a reason not to disallow errors as they occur rather than after the fact?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: check field for letters

Post by DavJans » Thu Oct 30, 2014 7:29 pm

I fixed it by adding a check on the other fields. on the welder fld I added, put 1 into checkWelser, when there was letters. and on the other fields, if checkWelder = 1 then select the text of fld "welder"
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Post Reply