|
-
Mar 23rd, 2005, 12:14 PM
#1
Thread Starter
New Member
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.
-
Mar 23rd, 2005, 03:00 PM
#2
Re: Receiving data in my client...placing in txt boxes....
 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
-
Mar 23rd, 2005, 04:01 PM
#3
Thread Starter
New Member
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 ?
-
Mar 23rd, 2005, 04:05 PM
#4
Hyperactive Member
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 
-
Mar 23rd, 2005, 08:17 PM
#5
Thread Starter
New Member
Re: Receiving data in my client...placing in txt boxes....
 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!
-
Mar 23rd, 2005, 08:43 PM
#6
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|