Private Function fun_get_location(ByVal intCol As Integer, ByVal intStart As Integer, ByVal intEnd As Integer) As Integer Dim i As Integer Dim strTemp As String Dim blnRun As Boolean Dim intBegin As Integer Dim intFind As Integer
For i = intStart \ 2 + 1 To intEnd strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol) Next i
intBegin = 1 blnRun = True
While blnRun intFind = InStr(intBegin, strTemp, Text1.Text)
If intFind > 0 Then If intFind Mod 2 = 1 Then intBegin = intFind + Len(Text1.Text) Else blnRun = False End If Else blnRun = False End If Wend
If intFind > 0 Then fun_get_location = intStart + intFind + Len(Text1.Text) - 1 Else fun_get_location = 0 End IfEnd Function
反了 Private Function fun_get_location(ByVal intCol As Integer, ByVal intStart As Integer, ByVal intEnd As Integer) As Integer Dim i As Integer Dim strTemp As String Dim blnRun As Boolean Dim intBegin As Integer Dim intFind As Integer
For i = intStart \ 2 + 1 To intEnd strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol) Next i
intBegin = 1 blnRun = True
While blnRun intFind = InStr(intBegin, strTemp, Text1.Text)
If intFind > 0 Then If intFind Mod 2 = 0 Then intBegin = intFind + Len(Text1.Text) Else blnRun = False End If Else blnRun = False End If Wend
If intFind > 0 Then fun_get_location = intStart + intFind + Len(Text1.Text) - 1 Else fun_get_location = 0 End IfEnd Function
Dim i As Integer
Dim strTemp As String
Dim blnRun As Boolean
Dim intBegin As Integer
Dim intFind As Integer
For i = intStart \ 2 + 1 To intEnd
strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol)
Next i
intBegin = 1
blnRun = True
While blnRun
intFind = InStr(intBegin, strTemp, Text1.Text)
If intFind > 0 Then
If intFind Mod 2 = 1 Then
intBegin = intFind + Len(Text1.Text)
Else
blnRun = False
End If
Else
blnRun = False
End If
Wend
If intFind > 0 Then
fun_get_location = intStart + intFind + Len(Text1.Text) - 1
Else
fun_get_location = 0
End IfEnd Function
Private Function fun_get_location(ByVal intCol As Integer, ByVal intStart As Integer, ByVal intEnd As Integer) As Integer
Dim i As Integer
Dim strTemp As String
Dim blnRun As Boolean
Dim intBegin As Integer
Dim intFind As Integer
For i = intStart \ 2 + 1 To intEnd
strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol)
Next i
intBegin = 1
blnRun = True
While blnRun
intFind = InStr(intBegin, strTemp, Text1.Text)
If intFind > 0 Then
If intFind Mod 2 = 0 Then
intBegin = intFind + Len(Text1.Text)
Else
blnRun = False
End If
Else
blnRun = False
End If
Wend
If intFind > 0 Then
fun_get_location = intStart + intFind + Len(Text1.Text) - 1
Else
fun_get_location = 0
End IfEnd Function