' BubbleSort
function bubblesort(arrsort)
for i = 0 to ubound(arrsort) - 1
for j = i + 1 to ubound(arrsort) - 1
s1 = Split(arrsort(i), ",", -1, vbTextCompare)
filesize1 = s1(2)
s2 = Split(arrsort(j), ",", -1, vbTextCompare)
filesize2 = s2(2)
if filesize1 < filesize2 then
arrTemp = arrsort(i)
arrsort(i) = arrsort(j)
arrsort(j) = arrTemp
end if
next
next
bubblesort = arrsort
end function
'...
Set files = fo.Files
i = 0
ReDim file_array(files.Count)
For Each file In files
file_array(i) = file & "," & file.DateLastModified & "," & file.Size & "," & file.Name
i = i + 1
Next
ReDim sortedarray(files.Count)
sortedarray = bubblesort(file_array)
For i = 0 To ubound(sortedarray) - 1
s = Split(sortedarray(i), ",", -1, vbTextCompare)
Filedate = s(1)
Filesize = s(2)
Filename = s(3)
ts.WriteLine "<tr>"
ts.WriteLine "<td class='date'>" & Filedate & "</td>"
ts.WriteLine "<td class='size'>" & Filesize & "</td>"
ts.WriteLine "<td class='name'>[
url='" & fo.Path & "/" & FileName & "']" & Filename & "[/
url]</td>"
ts.WriteLine "</tr>"
Next