|
楼主 |
发表于 2017-2-3 17:21
|
显示全部楼层
本帖最后由 考试加油站 于 2017-2-3 17:23 编辑
其中引用了这个RFIND,能给解释一下这个函数每句意思吗- Public Function rFind(ByVal txt As String, ByVal code1 As String, Optional ByVal code2 As String = """", Optional ByVal rev As Boolean = False)
- On Error Resume Next
- Dim tmp As String, i1 As Long, i2 As Long
- tmp = txt
- If InStr(tmp, code1) = 0 Then rFind = "": Exit Function
- i1 = InStr(tmp, code1) + Len(code1)
- tmp = Mid(tmp, i1)
- If InStr(tmp, code2) = 0 Then rFind = "": Exit Function
- If rev Then
- i2 = InStrRev(tmp, code2)
- Else
- i2 = InStr(tmp, code2)
- End If
- rFind = Mid(tmp, 1, i2 - 1)
- End Function
复制代码
特别是TMP,CODE1,2,I1,I2,及最后的RFIND都是得到什么结果,什么意思,最好能解释每句话意思,拜托
|
|