Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting numeric position of last string in a string
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Getting numeric position of last string in a string
Miscellaneous
Thread ID:
00754262
Message ID:
00754262
Views:
46
I am trying to get the numeric position of a string inside a string. The string looks like this:

"CHANGE ORDER 01CHANGE ORDER 02CHANGE ORDER03"

The string to search is "CHANGE ORDER". I want to get the right most string position, which in this case should be 31, but it comes up as zero (0) when I use the following code:
lcComments = "CHANGE ORDER 01CHANGE ORDER 02CHANGE ORDER03"
lnLastStringPosition=RAT(lcComments,"CHANGE ORDER")
?lnLastStringPosition
Why this comes out as a value of 0, I do not understand.

Perhaps my 10-mile hike with my son and his SCOUT Troop this past weekend in Joshua Tree, California, has affected my mental skills.
Next
Reply
Map
View

Click here to load this message in the networking platform