Quote:
Originally posted by Azuth
Here ya go:
Function CountChar(strMystring, strSeekChar) as Integer
Dim Y as Integer
Dim strChar as String
Dim Count as Integer
Count = 0
Y = 0
While Y < Len(strMystring)
strChar = Mid(strMystring, Y, 1)
If strChar = strSeekChar Then
Count = Count + 1
End If
Y = Y + 1
Loop
CountChar = Count
End Function
Something along those lines should do it.
Arg! :( You used a variable where you didn't need it, you used a function where you shouldn't have, and you used a while loop in exactly the same way a for loop works! :(