Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stumped
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00094441
Message ID:
00094872
Views:
22
>>>My brain must be fried today or something. What is the command to obtain the location of the rightmost character(other than a space) in a field. Example, a 25 character field with city and state separated by a space between city and state. If I grab the last two valid characters in the field, I have the state. I can't use the AT function because some cities are two words.
>>>
>>>HELP. I know that this is a no brainer! Thanks everyone
>>>
>>>Bill
>>
>>Bill,
>>
>>I can't resist sharing a solution that you can use with the FOXTOOLS library. After SET LIBRARY TO FOXTOOLS, you can use:
>>* Number of words
>>lnwords = Words(lcstring)
>>* The last one
>>lclast = WordNum(lcstring, lnwords)
>
>UT is better than Devcon. I think I'm going to run a contest next time to see how many different ways one function can be written. Thanks George!

You're welcome, Bill. I think you'd probably get a very large number of responses to that contest. One of the things I love about programming is that, often, there's no one right way to do something. So it becomes a statement of both creativity and self.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform