Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check this validaion?
Message
De
07/07/1999 19:01:32
 
 
À
07/07/1999 18:43:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00238591
Message ID:
00238595
Vues:
12
>I have following requirement
>
>I have one database field whose contents are either all letters are all digits. how could i check this validaion. Please help.
>
>i.e.
>example 1
>
>lcString = 'ABCD'
>
>this is valid string because all characters are lettes. but if it is 'ABC1' then it is not valid because 1 inside string is not letter.
>
>example 2
>
>lcString = '1234'
>
>this is valid string because all characters are digits. but if it is
>'12a4' then it is not valid because 'a' inside string is not digit.
>
>I have checked IsAlpha() and IsDigit() functions but i don't think they will be useful here. Please help me how could i check above validation and ensure that it is valid string.
>
>Thanks for your help in advance.
>Mark

Once you determine what the first character is wheter it is an alpha or character then you could
IF llIsAlpha
   *Loop through all chars make sure all are alpha
ELSE
   *Loop through all chars make sure all are digits
ENDIF
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform