Results 1 to 5 of 5

Thread: Stupedest Question ever

  1. #1
    Guest
    I've got a listbox, and I want to send it's item to another computer using winsock. The other computer than displays these items in a listbox on the client program.

    Everything works, except I get all the data into one single thing.. It's pissing me off cause I've tried using vbcrlf, chr(13), chr(10).. but all of them don't work.. I HAVE NO CLUE WHAT SO EVER HOW TO FIX THIS.. right now I'm tired and sleepy..

    HELP! WAHHH! i'm not a newbie, but this thing is giving me a head ache

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    your sending the entire listbox contents to the other computer, right?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Guest
    yea.. this is the code:

    Code:
    for i = 0 to list1.listcount - 1
    Stringtemp = StringTemp & List1.List(i)
    Next i
    
    winsock1.senddata StringTemp
    after stringtemp = stringtemp & list1.list(i) I've tried putting VBCRLF, VBNEWLINE, CHR(10) CHR(13).. but nothing works..

    when the data gets to the other computer, it's like this:

    stuff1stuff2stuff3stuff4

    I want it to be:
    stuff1
    stuff2
    stuff3
    stuff4

    cause that's how the data is on the host's list...

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    try using a separator like ":" or ",", and on the arrival of the data, use the Split() function and load the listbox from there. Ex:
    Code:
    Private Sub DataArrival(There's stuff that goes in here, but I don't know it all off hand)
    
    Dim tempData As Variant 'important
    
    Winsock.GetData strTemp
    
    tempData = Split(strTemp, ":") 'or whatever the separator is that you used
    
    For x = 0 to UBound(tempData)
    List1.AddItem tempData(x)
    Next x
    End Sub
    so the joining code would be:
    Code:
    strTemp = list1.List(0)
    for x = 1 to list1.ListCount - 1
      strTemp = strTemp & ":" & list1.List(x)
    next x




    [Edited by crptcblade on 11-22-2000 at 10:56 PM]
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Guest
    thanks a lot..

    I was already using a split function to split the command into 2..

    the program sent the datalist, but also sent a message before the datalist (with a dilemeter) to tell the client that I'm sending them a list so they know what to do with it. I was using split function for that. It didn't occur to me to add another dilemeter into the list sent (different from the first one) and use it to seperate the data of Variable(1) from the first one.

    I know sounds confusing, but I did half of what you said and half of what I was thinking, and now it worx...

    Thanks for your help.

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