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?
Printable View
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?Quote:
Originally Posted by stratty
:)
Pino
Im receiving integers and strings, for example:
Quantity: 25 Noise: 45
How can i split the quantity and noise ?
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:
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.Code:
Winsock1.GetData Data
Text1.Text = Split(Data, " ")(0)
Text2.Text = Split(Data, " ")(1)
Text3.Text = Split(Data, " ")(2)
Something like, if your split character is ¥ you can have the program send a packet like:
Then you can split that packet by using:Code:Dim Packet as String
Packet = "Hello" & SEP & "Hello2" & SEP & "Hello3" & SEP
Winsock1.SendData Packet
Just some examples of doing this. You can also use the Mid function as well.Code:Const SEP = "¥"
Winsock1.GetData Data
Text1.Text = Split(Data, "¥")(0)
Text2.Text = Split(Data, "¥")(1)
Text3.Text = Split(Data, "¥")(2)
This helped a lot, thanks! :thumb:Quote:
Originally Posted by wiccaan
Not a problem, glad to be able to help ya.