Link to home
Start Free TrialLog in
Avatar of mbosch
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
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

is this a school assignment?

AW
Avatar of mbosch
mbosch

ASKER

huh? no... its a job assignment... I KNOW ITS SIMPLE!  I'm just an idiot :-D
SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note that MikeDS's soultion is in .NET, not VB 6, if that makes a difference.

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.