mbosch
asked on
simple two-dimensional array sort
This is giving me alot of trouble. I have an array with n elements. Each element has a NAME and a SCORE
I need to sort the array descending by score... so the student with the highest score is at the top. 50 is the max scores the class may have,but there maybe less, which is where n - 1 comes in as the number of scores actually found for a particular class. This is what I have to sort:
Dim rankArray(50, 1) As Variant
rankArray(0,0) = "Mike"
rankArray(0,1) = 10
rankArray(1,0) = "John"
rankArray(1,1) = 3
Then I have to report the top 5 scores which is the reason I'm trying to sort the array. Help! :-\
-mario
I need to sort the array descending by score... so the student with the highest score is at the top. 50 is the max scores the class may have,but there maybe less, which is where n - 1 comes in as the number of scores actually found for a particular class. This is what I have to sort:
Dim rankArray(50, 1) As Variant
rankArray(0,0) = "Mike"
rankArray(0,1) = 10
rankArray(1,0) = "John"
rankArray(1,1) = 3
Then I have to report the top 5 scores which is the reason I'm trying to sort the array. Help! :-\
-mario
ASKER
huh? no... its a job assignment... I KNOW ITS SIMPLE! I'm just an idiot :-D
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
note that MikeDS's soultion is in .NET, not VB 6, if that makes a difference.
AW
AW
My code works in VB6, VBA not tried in Net? O I used my public Sort Class as I figured the issue was dealing with mult-demensioned array not the basic sort. I suppose that creates a confussion.
AW