Ok, I'm stuck. I'm making a highscore form that will update whenever the user gets some points, and when it updates it will check if the current score is higher than any of the others, and if it is it will move that name down the list along with the other names and will place the new score where it should go.. of course, I check to make sure it isn't the same name so that it won't keep printing the score whenever it changes.. I can get it mostly working, but not totally..

Does anyone know what's wrong with this?

mod_Main
VB Code:
  1. Public i As Integer, j As Integer
  2. Public hiscore(1, 9) As String, v_name As String, v_score As Integer
  3. Public game As New frm_Game, highscore As New frm_highScore
  4. Option Explicit
  5. Public Sub updateHiScore()
  6.   Dim tmpscore(1, 9) As String
  7.   'first populate the temp score array with the hiscore array elements
  8.   For i = 0 To 9 Step 1
  9.     tmpscore(0, i) = hiscore(0, i)
  10.     tmpscore(1, i) = hiscore(1, i)
  11.   Next i
  12.   'check if highscores should be updated
  13.   For i = 0 To 9 Step 1
  14.     If v_score > Val(hiscore(1, i)) And v_name <> hiscore(0, i) Then
  15.     'update the highscore as needed
  16.       For j = i To 8 Step 1
  17.         hiscore(0, (j + 1)) = tmpscore(0, j)
  18.         hiscore(1, (j + 1)) = tmpscore(1, j)
  19.       Next j
  20.       hiscore(0, i) = v_name
  21.       hiscore(1, i) = v_score
  22.       Exit For
  23.     ElseIf v_name = hiscore(0, i) Then
  24.       'add to the current user score
  25.       hiscore(1, i) = v_score
  26.     End If
  27.   Next i
  28.   'clear the highscore form
  29.   highscore.Cls
  30.   'now update the highscore form
  31.   highscore.Print "Name"; , , "Score"
  32.   For i = 0 To 9 Step 1
  33.     highscore.Print (i + 1) & ". " & hiscore(0, i); , , hiscore(1, i)
  34.   Next i
  35. End Sub

frm_Game
VB Code:
  1. Option Explicit
  2. Private Sub cmd_pnt_Click(Index As Integer)
  3.   Dim v_index As Integer
  4.   'increase the user score depending which button is clicked
  5.   'make sure to add one to the index to make it not multiply by 0!
  6.   v_index = Index + 1
  7.   'v_index * 10 makes: 1 = 10, 2 = 20, 3 = 30
  8.   v_score = v_score + (v_index * 10)
  9.   'update the highscore
  10.   updateHiScore
  11. End Sub

The game part of this is really simple, I'm just trying things out.. I took out things in the form that wouldn't be of any use for solving this for easy reading.. When running the current code, it will print to the highscore form, but it will keep putting down the same username.. It will move different usernames down, but it will put the same username down again and again.