Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IsNumeric - VFP analogue?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00307922
Message ID:
00308222
Views:
39
>Jim,
>
>My intention was opposite. I want that users type 5 digits only - no dots, commans, minus/plus, etc. Right now I changed my code this way:
>if len(lcString)<>5 or !IsNumeric(lcString)
> =messagebox(...)
> return .f.
>endif
Nadya,

If this is user input then stop all this work and do it the easy way,

Set the Textbox InputMask to "99999"

Then in the Valid do this;
DO CASE
   CASE INT(VAL(This.Value)) <> VAL(This.Value)
      * Problem somehow got a decimal point it there
   CASE VAL(This.Value) < 0
      * Problem negative number
   CASE LEN(ALLTRIM(This.Value)) < 5
      * Problem didn't fill the field
ENDCASE
They user can't make teh field more than 5 chars because of the InputMask, they cannot enter non-digit characters for the same reason, so the only things you need to check on are in the case list.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform