Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Urgent Help needed - string operations (no RegExp, pleas
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00597614
Message ID:
00597754
Views:
28
This message has been marked as a message which has helped to the initial question of the thread.
Hi Nadya,

Good idea! It makes code much simplier.
DO CASE
CASE lcAPNUniform = lcMask
	llOk = .T.
CASE NOT LIKE( CHRTRAN(lcMask, "X", "?"), lcAPNUniform )
	llOk = .F.
CASE chrtran(lcAPNUniform,'X','9')=chrtran(lcMask,'X','9')
	llOk = .T.
OTHERWISE
	llOk = .F.
ENDCASE
>
>I have a file with MapRef field filled. Based on this field I calculate APN in the whole file by some algorithm (different function for each town). So, I scan the file and calculate APN for each record. I also want to perform some validation during this loop. I don't want to use RegExp, because it would be much slower, than native VFP functions. I like Sergey's idea. It's simple and doesn't require lots of changes in the current ValidateAPN1 function. His idea could be further simplified, because case 3 could be checked chrtran(lcAPNUniform,'X','9')=chrtran(lcMask,'X','9') since the previous case already checks for difference...
>
>>Nadya --
< snip >
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform