Displaying Source Code(s)
|
|
ExchangeSort Function
--------------------------------------------------------------------------------
Description : The ExchangeSort function sorts an array
alphabetically (A - Z) or numerically (low to high).
ExchangeSort expects an array as input
<%
Private Function ExchangeSort(ByVal unsortedarray)
Dim Front, Back, I, Temp, Arrsize, Excom, Exswap
Arrsize = UBound( unsortedarray )
For Front = 0 To Arrsize
For Back = Front To Arrsize
Excom = Excom + 1
If unsortedarray(Front) > unsortedarray(Back) Then
Temp = unsortedarray(Front)
unsortedarray(Front) = unsortedarray(Back)
unsortedarray(Back) = Temp
Exswap = Exswap + 1
End If
Next
Next
ExchangeSort = unsortedarray
End Function
%> |
|
|