Results 1 to 7 of 7

Thread: Trailing Square Symbols Behind Message

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    167

    Trailing Square Symbols Behind Message

    Hi all ,
    I have run the following program (es explained at the link):

    http://www.vbforums.com/showthread.p...45#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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Trailing Square Symbols Behind Message

    Code:
    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
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    167

    Re: Trailing Square Symbols Behind Message

    thanks! that worked!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Trailing Square Symbols Behind Message

    Quote Originally Posted by quddusaliquddus View Post
    thanks! that worked!
    Of course it worked. You sound surprised.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Talking Re: Trailing Square Symbols Behind Message

    Quote Originally Posted by jmcilhinney View Post
    Code:
    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
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Trailing Square Symbols Behind Message

    Quote Originally Posted by Lightning View Post
    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    167

    Re: Trailing Square Symbols Behind Message

    lol.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width