vbs的sort排序

时间:2022-06-01 12:42:22
  1. Function fSortArray(aSortThisArray)  
  2. Dim oArrayList, iElement  
  3. Set oArrayList = CreateObject( "System.Collections.ArrayList" )  
  4. For iElement = 0 To UBound(aSortThisArray)  
  5. oArrayList.Add aSortThisArray(iElement)  
  6. Next  
  7. oArrayList.Sort  
  8. set fSortArray = oArrayList  
  9. End Function  
  10.  
  11. myarray=Array(50,20,30)  
  12. MsgBox myarray(0)  
  13. MsgBox fSortArray(myarray)(0)  
  14.  
  15. 'CreateObject( "System.Collections.ArrayList" )调用了mscoree.dll,是.NET Framework相关组件。