Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking string for predefined format
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00403485
Message ID:
00403859
Views:
29
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)," ","-"))
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform