Results 1 to 3 of 3

Thread: send array using winsock!!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Resolved send array using winsock!!

    how to send array using winsock???

    VB Code:
    1. dim abc(10) as string
    2.  
    3. winsock.sendData (abc())
    4. 'can it work??
    Last edited by kenny_oh; Oct 5th, 2005 at 10:59 AM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: send array using winsock!!

    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.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: send array using winsock!!

    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.
    VB Code:
    1. Dim strArray As String
    2.  
    3. strArray = Join(abc, ",")
    4.  
    5. winsock.sendData strArray

    At the receiving end, simply use the split function to reconstruct the array:
    VB Code:
    1. abc = Split(strArray, ",")
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

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