Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking string for predefined format
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00403485
Message ID:
00403549
Vues:
18
>Never mind ... TRANSFORM doesn't handle 9s the way I thought it would. Sergey's solution looks pretty slick though.

I've just discovered, that it allows '+','-' and ' ', if it's '9'

>zahid
>
>>Nadya -
>>
>>I haven't tried this but I think it should work. The expression:
>>(lcMyAPN = TRANSFORM(lcMyAPN, "999999X-X999999X-X999999XX-XX999999X-XXXXXX"))
>>should return .T. if the APN matches the format string.
>>
>>Let me know if I'm right :)
>>zahid
>>
>>
>>>Hi everyone,
>>>
>>>For APN I have this format:
>>>999999X-X999999X-X999999XX-XX999999X-XXXXXX,
>>>
>>> where 9 is a digit,
>>> X as upper case alpha,
>>> and - is hyphen.
>>>
>>>I have an UDF, which determines, is APN valid by inspecting each character. I'm just curious, is there more elegant and simple solution (and should be faster, of course)?
>>>
>>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform