vbs的sort排序
(编辑:jimmy 日期: 2024/11/15 浏览:3 次 )
Function fSortArray(aSortThisArray)
Dim oArrayList, iElement
Set oArrayList = CreateObject( "System.Collections.ArrayList" )
For iElement = 0 To UBound(aSortThisArray)
oArrayList.Add aSortThisArray(iElement)
Next
oArrayList.Sort
set fSortArray = oArrayList
End Function
myarray=Array(50,20,30)
MsgBox myarray(0)
MsgBox fSortArray(myarray)(0)
'CreateObject( "System.Collections.ArrayList" )调用了mscoree.dll,是.NET Framework相关组件。
Dim oArrayList, iElement
Set oArrayList = CreateObject( "System.Collections.ArrayList" )
For iElement = 0 To UBound(aSortThisArray)
oArrayList.Add aSortThisArray(iElement)
Next
oArrayList.Sort
set fSortArray = oArrayList
End Function
myarray=Array(50,20,30)
MsgBox myarray(0)
MsgBox fSortArray(myarray)(0)
'CreateObject( "System.Collections.ArrayList" )调用了mscoree.dll,是.NET Framework相关组件。
下一篇:vbs解答一道初中数学题i,x,y