-
Hey people how you doing today ? I'm ok thanx for asking .
Heres what I Got
Code:
Public Type User
Nick As String
winsockindexnumber As Integer
End Type
Dim Count as Integer
Dim usr() As User
Public Sub addUser(socknum As Integer, Nick As String)
Dim Loops As Integer
Dim this As Integer
Dim guytoadd As String
Dim total As Integer
frm_Server.lst_users.Visible = True
ReDim Preserve usr(Count)
usr(Count).winsockindexnumber = socknum
usr(Count).Nick = Nick
Count = TheCount + 1
For i = 0 To UBound(usr)
frm_Server.lst_users.AddItem usr(i).Nick
Next i
End Sub
That creates my array of users , No problem . What I Need to be able to do is remove a possition from the array , while not losing the array . Lets say I have 3 entries how can I remove one . I figure that the indexs will change but thats not a problem
-
Here the code to remove an item from the array and List box:
for i = 0 to UBound(usr)
if usr(i).nick = "Target string" then
idx = i
for k = i to UBound(usr) - 1
usr(k)= usr(k+1)
next k
end if
next i
frm_Server.lst_users.removeitem idx