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