NEED help with an array - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

NEED help with an array

flynpat32flynpat32 Posts: 33Member
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.