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: support at monkeybreadsoftware dot de (Christian Schmitz)
Date: Wed, 30 Jan 2002 22:01:45 +0100
>   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.

Mfg
Christian

-- 
Think Different! 
An Apple a day keeps Wintel away!

http://www.christians-software.de (Free Mac/Win software)


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