how to know which is the Second highest or Third in many objects

Vasudev

New member
Joined
May 28, 2005
Messages
2
Programming Experience
Beginner
I am learning vb.net myself. I am a beginner.
How can get the result - Who is second highest?
Currently there are three objects (May be more...).

A=20
B=10
C=5

(I gave those values for my understanding only. Actually the end-user have to enter those. So, we cannot guess them)
If a>b Xor a>c Then
MsgBox ("A is the second highest")
If b>a Xor b>c Then
MsgBox ("B is the second highest")
Else
MsgBox ("C is the second highest")
End If

To get whhich is the Highest Number I use (IF a>b And a>c)- like this...
If I have more than three (Ex: Seven), how can I decide which is the highest second or highest third?

What is the SIMPLEST WAY to achieve this?
 
I think the simplest way to achieve that is to put all the values into a hidden combobox, then set Combobox1.Sorted = True. Now you can read them from the Combobox1.SelectedIndex. This should give you the idea :)
 
Back
Top