asp数组随机排序
功能:將一個數組打亂它的順序,顯示出來,讓每一次顯示出來的順序都不一樣。
<%
Dim tt
tt=Split("1,2,3,4,5,6",",")
'隨機排序??
leng=UBound(tt)
randomize??
for ii=0 to leng-1??
?b=int(rnd()*leng)??
?temp=tt(b)??
?tt(b)=tt(ii)??
?tt(ii)=temp
Next
?
For i=0 To leng
?response.write tt(i)&"<br>"
next
%>
總結
- 上一篇: JavaScript函数小集锦
- 下一篇: asp利用dictionary创建二维数