PDA

View Full Version : Error.. Expected Array?


Demon
12-14-03, 11:23 PM
Ok, I have been debugging a program that is in the works and when I press the Disconnect button its supposed to remove my IP from the list of users that are active, this should happen in the Server form. But when I press the Disconnect button I get this error:
Compile Error:

Expected Array

heres the code that it says has something wrong with it, the bolded text is what it says is wrong...

Public Sub LogOffUser(bIPAddress As String)
Dim cUserData As String, cUserIP As String, cUserSocket As String
Dim i As Integer, bUserName As String
For i = 1 To UserCollection.ListCount
Debug.Print "UserCollection.Item(" & i & "): " & UserCollection.List(i)
cUserData = Split(UserCollection.List(i), cDelimiter)
cUserIP = cUserData(0): cUserSocket = CInt(cUserData(1))
If cUserIP = bIPAddress Then
UserCollection.RemoveItem (i) ' Remove the information from the collection
i = i - 1
If i = 0 Then Exit Sub
End If
Next i
End Sub

Can any one tell me whats wrong?