PDA

Click to See Complete Forum and Search --> : Trailing Square Symbols Behind Message


quddusaliquddus
Apr 16th, 2009, 02:13 PM
Hi all :D,
I have run the following program (es explained at the link):

http://www.vbforums.com/showthread.php?p=3495845#post3495845

Now I get the message text in the chat window but with trailing square characters after it.

Can someone help me remove these please?

Thanks

Q

jmcilhinney
Apr 17th, 2009, 12:23 AM
Private Sub getMessage()
For infiniteCounter = 1 To 2
infiniteCounter = 1
serverStream = clientSocket.GetStream()
Dim buffSize As Integer
Dim inStream(10024) As Byte
buffSize = clientSocket.ReceiveBufferSize
Dim dataLength As Integer = serverStream.Read(inStream, 0, buffSize)
Dim returndata As String = _
System.Text.Encoding.ASCII.GetString(inStream, 0, dataLength)
readData = "" + returndata
msg()
Next
End Sub

quddusaliquddus
Apr 17th, 2009, 02:13 AM
thanks! that worked!

jmcilhinney
Apr 17th, 2009, 02:16 AM
thanks! that worked!Of course it worked. You sound surprised. ;)

Lightning
Apr 22nd, 2009, 03:39 AM
Private Sub getMessage()
For infiniteCounter = 1 To 2
infiniteCounter = 1
serverStream = clientSocket.GetStream()
Dim buffSize As Integer
Dim inStream(10024) As Byte
buffSize = clientSocket.ReceiveBufferSize
Dim dataLength As Integer = serverStream.Read(inStream, 0, buffSize)
Dim returndata As String = _
System.Text.Encoding.ASCII.GetString(inStream, 0, dataLength)
readData = "" + returndata
msg()
Next
End Sub

WOW that is one of the most weird infinite loops I have ever seen

jmcilhinney
Apr 22nd, 2009, 04:47 AM
WOW that is one of the most weird infinite loops I have ever seen"weird" isn't the half of it. I just want to point out that that code wasn't mine. I was just modifying the code that the OP got from another source. That loop is downright shameful.

quddusaliquddus
Apr 22nd, 2009, 07:40 AM
lol.