Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Force field content
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346533
Message ID:
01346539
Views:
10
This message has been marked as the solution to the initial question of the thread.
Something like
lcDigits = "0123456789"
lcLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lcAllowedChars = lcDigits + lcLetters 
lcValue = "7CM4991"
* Is it valid?
? LEN(CHRTRAN(lcValue, lcAllowedChars, "")) = 0 ;
		AND LEN(CHRTRAN(lcValue, lcDigits, "")) > 0 ;
		AND LEN(CHRTRAN(lcValue, lcLetters, "")) > 0
>I have a field
>
>Suppose use enter data to the field, as would like the behaivor as below:
>
>"ABDF"
>= messagebox ("Field must contain numbers and letters")
>
>"8887"
>= messagebox ("Field must contain numbers and letters")
>
>7CM4991
>= messagebox ("OK")
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform