Bob Schneider
asked on
Quicker Array Sorting
Here is some code I have for populating an array and then sorting it. Can someone show me what it would look like with a quicker sorting method?
Thanks!
Thanks!
For k = 0 to UBound(Races, 2) - 1
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT p.ParticipantID, p.FirstName, p.LastName, rc.Bib, p.Gender, rc.Age, p.City, p.St, p.Phone, p.DOB, p.Email, rg.RaceID FROM "
sql = sql & "Participant p INNER JOIN PartReg rg ON p.ParticipantID = rg.ParticipantID JOIN PartRace rc "
sql = sql & "ON rc.ParticipantID = p.ParticipantID WHERE rc.RaceID IN (" & sEventRaces & ") " & sOrderBy
rs.Open sql, conn, 1, 2
PartArray=rs.GetRows()
rs.Close
Set rs=Nothing
Next
'sort the array
If sSortBy = "bib" Then
For i = 0 to UBound(PartArray, 2) - 2
For j = i + 1 to UBound(PartArray, 2) - 1
If CInt(PartArray(2, i)) > CInt(PartArray(2, j)) Then
For k = 0 to 11
TempArray(k) = PartArray(k, i)
PartArray(k, i) = PartArray(k, j)
PartArray(k, j) = TempArray(k)
Next
End If
Next
Next
End If
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.
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.
ASKER
Top shelf as always!
ASKER