Public function testnumber(ByVal data As String, ByVal sign As String, ByVal length As Integer) as integer
Dim sdata As String
Dim i As Integer
static j as integer (每次递归调用时j的值不会变)
If Len(data) < length Then
Exit Sub
End If
j = j + 1
If Len(data) - length >= length Then
sdata = Mid(data, length + 1, Len(data) - length + 1)
i = InStr(1, sdata, sign, vbTextCompare)
sdata = Right(sdata, Len(sdata) - i + 1)
testnumber sdata, sign, length, j
End If testnumber=j(用f8调试时testnumber的值自动减少,假如把它放到前面可以解决但是又怎么把j的值清为零)此时testnumber的值为什么会自动减一,怎样解决请各位大侠指教
End Sub
Dim sdata As String
Dim i As Integer
static j as integer (每次递归调用时j的值不会变)
If Len(data) < length Then
Exit Sub
End If
j = j + 1
If Len(data) - length >= length Then
sdata = Mid(data, length + 1, Len(data) - length + 1)
i = InStr(1, sdata, sign, vbTextCompare)
sdata = Right(sdata, Len(sdata) - i + 1)
testnumber sdata, sign, length, j
End If testnumber=j(用f8调试时testnumber的值自动减少,假如把它放到前面可以解决但是又怎么把j的值清为零)此时testnumber的值为什么会自动减一,怎样解决请各位大侠指教
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货