cjkenworthy
Programmer
I've found out that using Jscript's sorting algorithm can be faster than doing a bubble sort so am using the following code. However it is not generating a sorted array. I want it to overwrite my unsorted array and return it sorted (the array is called 'SoftwareUsers') :
<script language=JScript runat=server>
function SortVBArray(arrVBArray) {
return arrVBArray.toArray().sort().join('\b');
}
</script>
<%
Function SortArray(arrInput)
SortArray = Split(SortVBArray(arrInput), Chr(8))
End Function
SortArray(SoftwareUsers)
'This remains unsorted when outputted...
for i=0 to UBound(arrInput)
response.write(arrInput(i) & "<br>")
next
%>
<script language=JScript runat=server>
function SortVBArray(arrVBArray) {
return arrVBArray.toArray().sort().join('\b');
}
</script>
<%
Function SortArray(arrInput)
SortArray = Split(SortVBArray(arrInput), Chr(8))
End Function
SortArray(SoftwareUsers)
'This remains unsorted when outputted...
for i=0 to UBound(arrInput)
response.write(arrInput(i) & "<br>")
next
%>