Function mot(ch As String, c As Char, i As Integer) As Integer
Dim j As Integer
Dim a As Integer
Dim k As Integer
j = InStr(ch, 1, c)
If j = -1 Then
mot = j
ElseIf j = i Then
mot = 0
Else
For k = j To Len(ch) - 1
If Mid(ch, k, 1) = c Then
a = a + 1
End If
Next
mot = a
End If
End Function
Highligh:第一行(功能mot ...) 错误:未定义用户定义的类型
答案 0 :(得分:4)
你是真的,你在谈论VB6吗?我不记得VB6中的数据类型“CHAR”。尝试字符串类型。