Need to host a subversion repository? Try our hosted development tools.

Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 1686
Number of posts: 4894

This Forum Only
Post New Thread

Report
NEED help with an array Posted by flynpat32 on 21 Nov 2009 at 2:02 PM
Hello.
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
Else
indexteam += 1
End If
Loop

.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



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.