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: Paul <buddy at goodlearning dot com>
Date: Wed, 30 Jan 2002 12:45:57 -0600
There might be a "better" way to do this...
But what I have done is to add the following to the EditField's KeyDown event:

  if Asc(Key)>47 and Asc(Key)<58 then
    return false
  else
    return true
  end if

This only allows zero through 9 to actually make it into the box.

Paul Kaiser

J Draper wrote:
> 
> I have editfield1
> 
> I want to do a calculation on amount entered but user likes to enter
> 100,000
> 
> What the easy way to suppress the users comma?
> 
> Loop and check the ASCII value of each letter entered?
> 
> Is there a mask that can be ued on the input of data?
> 
> ---
> Subscribe to the digest:
> <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
> Unsubscribe:
> <mailto:realbasic-nug-off at lists dot realsoftware dot com>



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