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:
01512178
Views:
80
actually i am testing a table so len(Lname) simply gives me the length of the field in the table each time - that was my problem.
k
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform