Oliver wrote:
>>In your keyDownEvent event handler do:
>>
>>[...]
> 
> 
> But that, of course, doesn't prevent the user from
> entering something like "1-2.3-...24----24", so you'd
> still need to write code to validate that what was
> entered is actually a valid number, i.e.,
> 
> - minus character is at the beginning if used at all
> - only one decimal "point" if any at all
> - thousand separators in right place (if you want to
> support those
> ...
> 
> Oliver

What I do is that I take that string and use StrAToI to get a number, if 
that number is 0 then it means that the string entered was invalid. I 
mean what is the big deal to try to write some extremely complex routine 
that allows users only to enter valid number strings. Let users enter 
what they want (eg "1-2.3-...24----24") but then react accordingly. It 
will save you precious space.

/C


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to