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
Miscellaneous
Thread ID:
00754262
Message ID:
00754267
Views:
19
The parameters for RAT are backwards. It should be:
lnLastStringPosition = RAT("CHANGE ORDER", lcComments)
>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.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform