I'm kinda new to ASP (only about a year of writing it day to day) and have been severely stuck lately. I am trying to sort a multidimensional array in descending numeric order. Below is the code that I am using (thoughtfully provided to the community by Scott Mitchell)and it works just fine except I can't figure out to reverse the order of the sort. Any help would be greatly appreciated.<BR><BR>Sub SwapRows(ary,row1,row2)<BR> '== This proc swaps two rows of an array <BR> Dim x,tempvar<BR> For x = 0 to Ubound(ary,2)<BR> tempvar = ary(row1,x) <BR> ary(row1,x) = ary(row2,x)<BR> ary(row2,x) = tempvar<BR> Next<BR>End Sub 'SwapRows<BR><BR>Sub QuickSort(vec,loBound,hiBound,SortField)<BR><BR> '==--------------------------------------------------------==<BR> '== Sort a 2 dimensional array on SortField ==<BR> '== ==<BR> '== This procedure is adapted from the algorithm given in: ==<BR> '== ~ Data Abstractions & Structures using C++ by ~ ==<BR> '== ~ Mark Headington and David Riley, pg. 586 ~ ==<BR> '== Quicksort is the fastest array sorting routine for ==<BR> '== unordered arrays. Its big O is n log n ==<BR> '== ==<BR> '== Parameters: ==<BR> '== vec - array to be sorted ==<BR> '== SortField - The field to sort on (2nd dimension value) ==<BR> '== loBound and hiBound are simply the upper and lower ==<BR> '== bounds of the array's 1st dimension. It's probably ==<BR> '== easiest to use the LBound and UBound functions to ==<BR> '== set these. ==<BR> '==--------------------------------------------------------==<BR><BR> Dim pivot(),loSwap,hiSwap,temp,counter<BR> Redim pivot (Ubound(vec,2))<BR><BR> '== Two items to sort<BR> if hiBound - loBound = 1 then<BR> if vec(loBound,SortField) > vec(hiBound,SortField) then Call SwapRows(vec,hiBound,loBound)<BR> End If<BR><BR> '== Three or more items to sort<BR> <BR> For counter = 0 to Ubound(vec,2)<BR> pivot(counter) = vec(int((loBound + hiBound) / 2),counter)<BR> vec(int((loBound + hiBound) / 2),counter) = vec(loBound,counter)<BR> vec(loBound,counter) = pivot(counter)<BR> Next<BR><BR> loSwap = loBound + 1<BR> hiSwap = hiBound<BR> <BR> do<BR> '== Find the right loSwap<BR> while loSwap < hiSwap and vec(loSwap,SortField) <= pivot(SortField)<BR> loSwap = loSwap + 1<BR> wend<BR> '== Find the right hiSwap<BR> while vec(hiSwap,SortField) > pivot(SortField)<BR> hiSwap = hiSwap - 1<BR> wend<BR> '== Swap values if loSwap is less then hiSwap<BR> if loSwap < hiSwap then Call SwapRows(vec,loSwap,hiSwap)<BR><BR><BR> loop while loSwap < hiSwap<BR> <BR> For counter = 0 to Ubound(vec,2)<BR> vec(loBound,counter) = vec(hiSwap,counter)<BR> vec(hiSwap,counter) = pivot(counter)<BR> Next<BR> <BR> '== Recursively call function .. the beauty of Quicksort<BR> '== 2 or more items in first section<BR> if loBound < (hiSwap - 1) then Call QuickSort(vec,loBound,hiSwap-1,SortField)<BR> '== 2 or more items in second section<BR> if hiSwap + 1 < hibound then Call QuickSort(vec,hiSwap+1,hiBound,SortField)<BR><BR>E nd Sub 'QuickSort