Results 1 to 6 of 6

Thread: Receiving data in my client...placing in txt boxes....

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    London
    Posts
    7

    Resolved Receiving data in my client...placing in txt boxes....

    Hi there I am receiving data into my client program, at the moment i have it displaying in one text box, how can i get different bits of data to go in different text boxes?
    Last edited by stratty; Mar 23rd, 2005 at 08:15 PM.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Receiving data in my client...placing in txt boxes....

    Quote Originally Posted by stratty
    Hi there I am receiving data into my client program, at the moment i have it displaying in one text box, how can i get different bits of data to go in different text boxes?
    You will have to be more specific, what data is comming in? and how do you wnat to split it?



    Pino

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    London
    Posts
    7

    Re: Receiving data in my client...placing in txt boxes....

    Im receiving integers and strings, for example:

    Quantity: 25 Noise: 45

    How can i split the quantity and noise ?

  4. #4
    Hyperactive Member wiccaan's Avatar
    Join Date
    Apr 2004
    Location
    127.0.0.1
    Posts
    475

    Re: Receiving data in my client...placing in txt boxes....

    You can have it split the packets at certain sections and such.

    An example would be something like spliting the packet where ever theres a space:

    Code:
    Winsock1.GetData Data
    
    Text1.Text = Split(Data, " ")(0)
    Text2.Text = Split(Data, " ")(1)
    Text3.Text = Split(Data, " ")(2)
    And such like that. If you are sending the packets yourself, you can add space characters to the packets and have it split the packets by that character.

    Something like, if your split character is ¥ you can have the program send a packet like:

    Code:
    Dim Packet as String
    
    Packet = "Hello" & SEP & "Hello2" & SEP & "Hello3" & SEP
    Winsock1.SendData Packet
    Then you can split that packet by using:

    Code:
    Const SEP = "¥"
    
    Winsock1.GetData Data
    
    Text1.Text = Split(Data, "¥")(0)
    Text2.Text = Split(Data, "¥")(1)
    Text3.Text = Split(Data, "¥")(2)
    Just some examples of doing this. You can also use the Mid function as well.
    If my post was helpful please rate it

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    London
    Posts
    7

    Re: Receiving data in my client...placing in txt boxes....

    Quote Originally Posted by wiccaan
    You can have it split the packets at certain sections and such.

    An example would be something like spliting the packet where ever theres a space:

    Code:
    Winsock1.GetData Data
    
    Text1.Text = Split(Data, " ")(0)
    Text2.Text = Split(Data, " ")(1)
    Text3.Text = Split(Data, " ")(2)
    This helped a lot, thanks!

  6. #6
    Hyperactive Member wiccaan's Avatar
    Join Date
    Apr 2004
    Location
    127.0.0.1
    Posts
    475

    Re: Receiving data in my client...placing in txt boxes....

    Not a problem, glad to be able to help ya.
    If my post was helpful please rate it

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