Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid field name function
Message
From
26/02/2001 05:46:16
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00478825
Message ID:
00479431
Views:
42
Hi!

Well, I posted the main idea of checking. All other things could be added to expression, following is what I get:

!(cName=='') AND iif(plWorkingWithTable,len(cName)<=10,len(cName)<=128) AND ;
(IsAlpha(cName) OR left(cName,1)=='_') AND ;
chrtran(upper(cName), "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_", "") == ""

plWorkingWithTable should be .T. if field is for table (10 characters)

Note that you can remove underscore if you will ever use commands that cause bug with underscore-started field names (see message#479278).



>>Hi!
>>
>>llIsIdentifier = IsAlpha(cName) and chrtran(upper(cName), "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_", "") == ""
>>
>
>Actually, the lead character can be an underscore (_) as well, and unless the name is a long name in a DBC, it can't exceed 10 characters.
>
>>
>>
>>>Is there a function in Foxpro to tell me if a name is a valid field name or do I have to write this myself?
>>>
>>>It seems like i've seen it somewhere but I can't seem to find it.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform