Results 1 to 1 of 1

Thread: [RESOLVED] RESOLVED highscore list

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    146

    Resolved [RESOLVED] RESOLVED highscore list

    Hi

    im trying to send the data to the server 1 by 1 instead of just one string,
    but this way dont seem to work atall.

    i commented out some code and chucked a msgbox on to test it and it works successfully...i just cant do the same when sending the info from the server to the client.

    its most likely the dataArrival sub thats wrong so can somebody show me how its wrong and how to fix please.


    VB Code:
    1. Public Sub HighScore(index As Integer)
    2. On Error Resume Next
    3. Dim TopTen(9) As UserData
    4. Dim tmp As UserData
    5. Dim i As Long
    6. Dim j As Long
    7. Dim Msg As String
    8.  
    9. Msg = Chr$(251) & Chr$(2)
    10.  
    11.   ' In case the highest reputations could be less than zero
    12.   For i = 0 To 9
    13.     TopTen(i).Reputation = -999
    14.   Next i
    15.  
    16.   For i = 0 To UBound(UserDB)
    17.     If UserDB(i).Reputation > TopTen(9).Reputation Then
    18.       TopTen(9) = UserDB(i)
    19.       For j = 8 To 0 Step -1
    20.         If TopTen(j).Reputation < TopTen(j + 1).Reputation Then
    21.           tmp = TopTen(j)
    22.           TopTen(j) = TopTen(j + 1)
    23.           TopTen(j + 1) = tmp
    24.         Else
    25.           Exit For
    26.         End If
    27.       Next j
    28.     End If
    29.   Next i
    30.  
    31. For i = 0 To 9
    32.   Msg = TopTen(i).Reputation & TopTen(i).UName & TopTen(i).Rank
    33.   MsgBox Msg
    34.  
    35.   'frmMain.wsk(index).SendData Msg
    36.   'DoEvents
    37. Next i
    38.  
    39. End Sub

    'the below code is on the client

    VB Code:
    1. Private Sub wsk_DataArrival(ByVal bytesTotal As Long)
    2. Dim a As Integer
    3. Dim Msg As String
    4. Dim SplitMsg() As String
    5.  
    6.  
    7. wsk.GetData Msg, vbString
    8.  
    9. SplitMsg = Split(Msg, Chr$(0))
    10.  
    11. For a = 0 To UBound(SplitMsg) - 1
    12.    
    13.    Select Case Left$(SplitMsg(a), 2)
    14.       Case Chr$(251) & Chr$(2)
    15.          'frmMain.lsthighscore.AddItem Mid$(SplitMsg(a), 3) ' dont work
    16.    MsgBox Msg ' dont work
    17.    End Select
    Last edited by mrnew; Aug 8th, 2006 at 08:53 AM. Reason: fixed it myself, i can delete rpls never threads, weird sorry

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