Public Function vb5InstrRev(ByVal StringCheck As String, _
StringMatch As String, Optional Start As Long = -1, _
Optional Compare As VbCompareMethod = vbBinaryCompare) _
As Long
Dim lStartPoint As Long
Dim lEndPoint As Long
Dim lSearchLength As Long
Dim lCtr As Long
Dim sWkg As String
vb5InstrRev = 0
If Len(StringMatch) > Len(StringCheck) Then Exit _
Function
If Start < -1 Or Start = 0 Or Start > Len(StringCheck) _
Then Exit Function
lSearchLength = Len(StringMatch)
lStartPoint = IIf(Start = -1, Len(StringCheck), Start)
lEndPoint = 1
For lCtr = lStartPoint To lEndPoint Step -1
sWkg = Mid(StringCheck, lCtr, lSearchLength)
If StrComp(sWkg, StringMatch, Compare) = 0 Then
vb5InstrRev = lCtr
Exit Function
End If
Next lCtr
End Function
|