NEED help with an array

I am having trouble with an array.
The user enters a team and the array is to out in a textbox the teams rank. Its array index. All it does is output the team. Please help. I am pulling my hair out!!
Private Sub BtnLookUpTeam_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLookUpTeam.Click

Dim indexteam As Integer = 0
Dim foundboolean As Boolean = False

With Me
Do Until foundboolean Or indexteam > 10
If .TxtTeam.Text.ToUpper() = mTeam(indexteam) Then

foundboolean = True
indexteam += 1
End If

.TxtTeamRate.Text = mTeam(indexteam).ToString()

If Not foundboolean Then
MessageBox.Show("Enter a valid team.", "Entry error.", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If

End With
End Sub
Private Sub frmTopTenTeams_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Load Teams
mTeam(1) = "Oklahoma"
mTeam(2) = "USC"
mTeam(3) = "LSU"
mTeam(4) = "Michigan"
mTeam(5) = "Georgia"
mTeam(6) = "Texas"
mTeam(7) = "Tennessee"
mTeam(8) = "Ohio State"
mTeam(9) = "Florida State"
mTeam(10) = "Miami(FL)"

'Load Mascots
mMascot(1) = "Sooners"
mMascot(2) = "Trojans"
mMascot(3) = "Bengal Tigers"
mMascot(4) = "Wolverines"
mMascot(5) = "Bulldogs"
mMascot(6) = "Longhorns"
mMascot(7) = "Volunteers"
mMascot(8) = "Buckeyes"
mMascot(9) = "Seminoles"
mMascot(10) = "Hurricanes"
End Sub
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!