• Welcome to Valhalla Legends Archive.
 

Visual Basic woes

Started by Tazo, July 31, 2005, 08:02 AM

Previous topic - Next topic

Tazo

How would I go about removing the vbNewline or vbCrLf from incoming data? (if thats the problem)

sckIrc.GetData strTemp, vbString
                For i = 1 To Len(strTemp)
                    If InStr(strTemp, ":@version") = i Then
                    Dim x() As String
                    x() = Split(strTemp, ":@version")
                    x(1) = x(1) & " VERSION"
                    MsgBox "PRIVMSG " & x(1)
                    irc.SendData "PRIVMSG " & x(1) & vbCrLf
                    End If
                Next i

So I receive something like this..
myip@blah PRIVMSG #Tazo :@version tazo
I am trying to find the part after :@version, so i split by that. I get x(1). However, x(1) seems to have an invisible vbNewLine at the end of it or something?! I msgbox the data, and it looks like

PRIVMSG tazo
VERSION

And when i send "privmsg " & x(1), I get 2 lines, the first one saying " No text to send ", and the next one saying "VERSION:  unknown command"   so its safe to assume that, for whatever reason, there is a newline after x(1)..any idea how to remove this from the end of IRC messages, or fix this problem?

edit: i think its actually vbCrLf

UserLoser.


Blah = Replace(Blah, vbCrLf, vbNullstring)

Tazo

Worked, thank you very much!