realbasic-nug
[Top] [All Lists]

Re: Easy way to permit numbers exclusively?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Easy way to permit numbers exclusively?
From: Kevin Rudman <kevin dot rudman at ntlworld dot com>
Date: Wed, 30 Jan 2002 21:34:27 +0000
on 30/1/02 9:01 pm, Christian Schmitz at support at monkeybreadsoftware dot de
wrote:

>>   if key < "0" or key > "9" then
>>     return true
>>   end if
> 
> I think something like this is bad because you block all keys like:
> - backspace (code 8)
> - enter (code 3)
> - return (code 13)
> - tab (code 9)
> - cursor (codes around 28 to 31)
> - page up/down
> - delete key (code maybe 127)
> and some more
> 
> better disable the ok button in the textchange event if the number is
> not in range.
> 
That's probably not particularly good UI design. I'd agree with earlier
posters who had already suggested allowing certain characters through and
adding a beep to alert to an invalid key.

Kevin Rudman



<Prev in Thread] Current Thread [Next in Thread>