vbs的sort排序
程序员文章站
2022-03-22 10:07:39
function fsortarray(asortthisarray) dim oarraylist, ielement set o...
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相关组件。