If VarType( theFiles( 0 )( sortBy ) ) = 8 Then If reverse Then kind = 1 Else kind = 2 " 给字符排序 Else If reverse Then kind = 3 Else kind = 4 "数字、时间。。。 End If
For i = fileCount TO 0 Step -1 minmax = theFiles( 0 )( sortBy ) minmaxSlot = 0 For j = 1 To i Select Case kind Case 1 mark = (strComp( theFiles(j)(sortBy), minmax, vbTextCompare ) < 0) Case 2 mark = (strComp( theFiles(j)(sortBy), minmax, vbTextCompare ) > 0) Case 3 mark = (theFiles( j )( sortBy ) < minmax) Case 4 mark = (theFiles( j )( sortBy ) > minmax) End Select If mark Then minmax = theFiles( j )( sortBy ) minmaxSlot = j End If Next
If minmaxSlot <> i Then
temp = theFiles( minmaxSlot ) theFiles( minmaxSlot ) = theFiles( i ) theFiles( i ) = temp End If Next " 结束
For i = 0 To fileCount Response.Write "<TR>" & vbNewLine For j = 0 To UBound( theFiles(i) ) Response.Write " <TD>" & theFiles(i)(j) & "</TD>" & vbNewLine Next Response.Write "</TR>" & vbNewLine Next %> </TABLE>