PDA

Click to See Complete Forum and Search --> : send array using winsock!!


kenny_oh
Oct 3rd, 2005, 12:16 PM
how to send array using winsock???


dim abc(10) as string

winsock.sendData (abc())
'can it work??

dglienna
Oct 3rd, 2005, 05:18 PM
Nope, you have to send each element separately. Put a character between each one so the other side can translate them. A ~ is usually a good choice.

visualAd
Oct 3rd, 2005, 11:57 PM
Sending an array with winsock is possble. Remember though that the data you send should be a string, so convert the array into a string, separating each element with a comma.

Dim strArray As String

strArray = Join(abc, ",")

winsock.sendData strArray


At the receiving end, simply use the split function to reconstruct the array:

abc = Split(strArray, ",")