Valhalla Legends Forums Archive | Visual Basic Programming | Visual Basic woes

AuthorMessageTime
laurion
How would I go about removing the vbNewline or vbCrLf from incoming data? (if thats the problem)
[code]
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
[/code]
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
[code]
PRIVMSG tazo
VERSION
[/code]
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
July 31, 2005, 1:02 PM
UserLoser.
[code]
Blah = Replace(Blah, vbCrLf, vbNullstring)
[/code]
July 31, 2005, 1:20 PM
laurion
Worked, thank you very much!
July 31, 2005, 1:25 PM

Search