Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to sort multi-dimensional array by rows

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Let's say I have an array with FB Conferences and Teams:

Row1 Pac10, USC, 11-2
Row2 BigEast, Miami, 12-1
Row3 Pac10, WSU, 11-2
Row4 BigEast, BC, 7-4
Row5 Big10, Ohio State, 14-0
Row6 Big10, Iowa, 11-2
Row7 Pac10, UCLA, 7-4

etc

So I have a 6 by 2 array and I want to sort it by conference name. How is the best way to do this? If I test like this: If Array(0, row) > Array(0, row + 1) and I want to swap them, can I swap the entire row or do I need to spin through each element and swap them one at a time?

Thanks in advance for any help!
 
In an attempt to avoid opening the worm bag of yet another discussion of sorting, I will sugggest that you generate a recordset and let ye olde sql db thinggyy do the work,

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thanks Michael for both your answer and a chuckle for the sense of humor in its presentation.

Ye olde never to younge to learne friend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top