Soldato
I don't do VB so not sure on the syntax, but do you need to a Break in the loops?
On Error GoTo closeidentd ' <-- from here onward ...
identd.Listen
closeidentd: ' <-- ... go to this error jump point on error
ds1.Connect txtServer, 6667
On Error GoTo closeidentd
identd.Listen
closeidentd:
On Error GoTo 0
ds1.Connect txtServer, 6667
Public Sub SetEmo()
Dim j As Integer
Dim CharCombo() As String
Dim lFoundPosition2 As Long
Dim Emo()
Dim Icon()
'On Error Resume Next
For i = 0 To 30
CharCombo = Split(Emo(i), " ")
' Dim Emo()
' Dim Icon()
'On Error Resume Next
For i = 0 To 30
CharCombo = Split(Emo(i), " ")
For j = 0 To UBound(CharCombo)
lFoundPosition2 = InStr(lFoundPosition, txtMain.Text, CharCombo(j)) ' <-- here
For i = 0 To 30
For i = 0 To UBound(Emo)
Public Sub Form_Load()
txtServer.Visible = False
txtPort.Visible = False
txtRoom.Visible = False
txtNickName.Visible = False
ReDim Emo(16)
ReDim Icon(16)
Emo(1) = "(H) (h)"
Icon(1) = frmEmo.sunglass.Text
Emo(2) = ":P :p :-P :-p"
Icon(2) = frmEmo.Tongue.Text
Emo(3) = ":O :o :-o :-O"
Icon(3) = frmEmo.Oh.Text
Emo(4) = "(Y) (y)"
Icon(4) = frmEmo.thumbsup.Text
Emo(5) = ":) :-)"
Icon(5) = frmEmo.Smile.Text
Emo(6) = ":D :-D :d :-d :>"
Icon(6) = frmEmo.BSmile.Text
Emo(7) = ":( :-("
Icon(7) = frmEmo.Sad.Text
Emo(8) = ":| :-|"
Icon(8) = frmEmo.shut.Text
Emo(9) = ":'("
Icon(9) = frmEmo.cry.Text
Emo(10) = "(F) (f)"
Icon(10) = frmEmo.flower.Text
Emo(11) = ":s :S :-S :-s"
Icon(11) = frmEmo.SS.Text
Emo(12) = ";) ;-)"
Icon(12) = frmEmo.knipoog.Text
Emo(13) = ":@"
Icon(13) = frmEmo.angry.Text
Emo(14) = "(K) (k)"
Icon(14) = frmEmo.kiss.Text
Emo(15) = ":$ :-$"
Icon(15) = frmEmo.blush.Text
Emo(16) = "(A) (a)"
Icon(16) = frmEmo.angel.Text
txtNickName.Text = "Webchat_" & Format(Now, "mmss") 'this is the random name
txtRoom.Text = Replace(txtRoom.Text, " ", "\b")
CMode = 1
Dim localport As Long
ds1.Close
localport = 0
ds1.RemotePort = 6667
ds1.localport = localport
identd.localport = 113
On Error GoTo closeidentd
identd.Listen
closeidentd:
On Error GoTo 0
ds1.Connect txtServer, 6667
txtMain.SelColor = &H8000&
txtMain.SelItalic = False
txtMain.SelText = "Please wait, connecting to server..." & vbCrLf
ResetFontFormat
End Sub
Public Sub SetEmo()
Dim j As Integer
Dim CharCombo() As String
Dim lFoundPosition2 As Long
'Dim Emo()
'Dim Icon()
'On Error Resume Next
lFoundPosition = 1
For i = 0 To UBound(Emo)
CharCombo = Split(Emo(i), " ")
For j = 0 To UBound(CharCombo)
lFoundPosition2 = InStr(lFoundPosition, txtMain.Text, CharCombo(j))
While lFoundPosition2 > 0
txtMain.SelStart = lFoundPosition2 - 1
txtMain.SelLength = Len(CharCombo(j))
txtMain.SelRTF = Icon(i)
lFoundPosition2 = InStr(lFoundPosition2, txtMain.Text, CharCombo(j))
Wend
Next j
Next i
lFoundPosition = Len(txtMain.Text) - 1
End Sub