![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2005
Location: Charleston, SC
Posts: 11
Rep Power: 0
![]() |
not displaying lowest number
I am trying to display the lowest number using the for...each statement.
What is happening is either I get it to display the second number or the last number. Is my if statement in the correct location for starters and does it look the way it should or is it as messed up as me?
Dim scores() As Integer = {78, 87, 95, 94, 77, 82, 81, 82, 65, 45, _
66, 54, 32, 24, 100, 78, 86, 13, 92, 91}
Dim lowest As Integer
Dim x As Integer = 1
For Each lowest In scores
If scores(x) < lowest Then lowest = scores(x)
Next lowest
Me.xLowestLabel.Text = lowest.ToString()
End Sub |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Oct 2005
Location: Chitown
Posts: 422
Rep Power: 4
![]() |
Look at your x variable, what is it supposed to do?
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
x needs to put its best foot forward
![]()
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c-unix-childprocesses-random number | programmingnoob | C | 7 | Feb 6th, 2007 9:39 PM |
| Jython | Jessehk | Coder's Corner Lounge | 2 | Feb 5th, 2006 5:35 AM |
| [tutorial] Python for programming beginners | coldDeath | Python | 30 | Dec 14th, 2005 12:35 PM |
| FiveDigit + RandomeNumber Game. | TecBrain | Java | 0 | Nov 18th, 2005 3:53 PM |
| pointer number alteration | Blighttdm | C | 5 | Oct 14th, 2005 8:24 PM |