This code returns "End Select without Select case" and hightlights the FIRST End Select if you read from the top.Code:Private Sub wsk_DataArrival(ByVal bytesTotal As Long) Dim strData As String wsk.GetData strData Dim b() As String b() = Split(strData, vbCrLf) Dim x As Integer Dim a() As String Dim i As Integer For x = 0 To UBound(b) a() = Split(b(x), " ", 3) If UBound(a) > 0 Then Select Case a(0) Case "BUDDY" If a(1) = "ONLINE" Then frmBuddies.List1.AddItem (a(2)) StatusBar1.Panels(1).Text = "Online!" Else For i = 0 To frmBuddies.List1.ListCount If frmBuddies.List1.List(i) = a(2) Then frmBuddies.List1.RemoveItem i End If Next End If Case "CLOSE" wsk.Close Case "ERROR" MsgBox Left(a(1), 1) Case "XOP" Select Case a(3) 'NEEDS To BE 2 WHEN SERVER IS FIXED! Case "PRIVMSG" Dim arrInfo() As String arrInfo() = Split(a(2), " ") Dim lngFormIndex As Long lngFormIndex& = FormByTag(LCase(a(2))) 'LCase(Replace(tvwBuddies.SelectedItem.Text, " ", ""))) If lngFormIndex& > -1 Then Forms(lngFormIndex&).SetFocus Forms(lngFormIndex&).txtIN.Text = Forms(lngFormIndex&).txtIN.Text & Forms(lngFormIndex&).Caption & ": " & a(4) & vbNewLine Forms(lngFormIndex&).txtIN.SelStart = Len(Forms(lngFormIndex&).txtIN) Forms(lngFormIndex&).txtOut.SetFocus Else Dim frmNewIM As New frmIM With frmNewIM .Caption = a(2) .Tag = LCase(a(2)) .Show End With lngFormIndex& = FormByTag(LCase(a(2))) Forms(lngFormIndex&).SetFocus Forms(lngFormIndex&).txtIN.Text = Forms(lngFormIndex&).txtIN.Text & Forms(lngFormIndex&).Caption & ": " & a(4) & vbNewLine Forms(lngFormIndex&).txtIN.SelStart = Len(Forms(lngFormIndex&).txtIN) - 1 Forms(lngFormIndex&).txtOut.SetFocus End Select Case "NEXT HERE" 'blah End Select End If Next End Sub
If you want to put this in VB and see whats wtong, he is a function that is used in the top code:
Code:Public Function FormByTag(strMatch As String) As Long Dim lngDo As Long, lngFound As Long lngFound& = -1 For lngDo& = 0 To Forms.Count - 1 If Forms(lngDo&).Tag = strMatch$ Then lngFound& = lngDo& 'Forms(lngFound&).txtMessage.Text = strMessage Exit For End If Next FormByTag& = lngFound& 'Forms(FormByTag&).txtMessage.Text = strMessage End Function
Thanks alot!




Reply With Quote