Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IsNumeric - VFP analogue?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00307922
Message ID:
00308222
Vues:
40
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform