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:
00404009
Vues:
49
Sergey,

Again, great for noticing. I understood this bug at home too, but your message was a reminder to me to fix it. I'll do it right now.

Thanks again for your help. I noticed, you often use this technique, and I'll start too. I also will investigate "Ed's route"...

>Nadya,
>The code below
> inlist(substr(lcAPN,37,1)," ","-"))
>
>wouldn't work because lcAPN is 36 characters long. I think you ment pcAPN.
>

>
>>
>>I used function, Sergey proposed, with some modifications:
>>
>>********************************************************************
>>*  Description.......: ValidateAPN1
>>*  Calling Samples...: ValidateAPN1(APN)
>>*  Parameter List....:
>>*  Created by........:  Sergey Berezniker
>>*  Modified by.......: Nadya Nosonovsky 08/10/2000 04:47:29 PM
>>********************************************************************
>>lparameters pcAPN
>>local lcMask,  lcDigits, lcLetters, lcAPNUniform
>>
>>lcMask = "999999X-X999999X-X999999XX-XX999999X"
>>*lcAPN  = "000000 - 001000 - 000000  -  000000"
>>lcApn = padr(ltrim(pcAPN),36)
>>lcDigits = "0123456789"
>>lcLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "
>>lcAPNUniform = chrtran( lcAPN, lcDigits+lcLetters, ;
>>     replicate("9", 10)+ replicate("X", 27))
>>
>>*wait window lcAPNUniform+' lcMask:'+lcMask+" lcAPN:"+substr(lcAPN,37,1)
>>
>>return (left(lcAPNUniform,36) = lcMask and inlist(substr(lcAPN,37,1)," ","-"))
>>
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform