Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ensure string has no special characters
Message
 
 
To
13/02/2008 12:56:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01292266
Message ID:
01292283
Views:
26
>There's always:
TRY
>    CREATE CURSOR curTest (&UserString I)
>    USE IN curTest
>    llUserStringValid = .T.
>CATCH TO loEx
>    llUserStringValid = .F.
>ENDTRY
>
>>I'm guessing someone already as an easy routine or command for this. I'm letting the users create a string which later is used to create a cursor for running a special report. I need to validate that the characters they entered in the string will be valid in a field name. Does anyone have an easy way to do this?

Should be also easy to set a pattern - first letter is always a letter and next can be letter, number or underscore.

Anyway, Sergey already wrote it without regular expressions with one small typo at the end.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform