Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check length of character string
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01512090
Message ID:
01512107
Views:
58
>thanks viv - sometimes you just have to learn to think like a computer
>k
>
>>>sorry a quicky question here.
>>>I have been persuing help and can't seem to find reference for this
>>>how do i check the character length within a field length
>>>
>>>lname is a field 30 characters
>>>the name 'smith' is 5 characters
>>>i am trying to get 5 as the response.
>>>
>>>? len(Lname)  &&& give me the length of the field not the contents.
>>>
>>
len(trim(lname))
?

There is this:
len(lname) ...which will give you the number of characters.

If you do this:
len(alltrim(lname)) it excludes the beginning and ending spaces...so..

lname = "me "

len(lname) = 3
len(alltrim(lname)) = 2

...works the same if the spaces are at the front too...so

lname = " me "
len(lname) = 4
len(alltrim(lname)) = 2
ICQ 10556 (ya), 254117
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform