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
%>
相关文档:
<%
Do_Url = "http://"
'Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/shownews.asp" 主目录
aa=Request.Servervariables("url") '虚拟目录
bb=InstrRev(aa,"/")
cc=left(aa,bb)
Do_Url = Do_Url&Request.ServerVariables("HTTP_HOST")&cc&"index.asp"
call SaveFile("index.h ......
'**************************************************
'函数名:FSOFileRead
'作 用:使用FSO读取文件内容的函数
'参 数:filename ----文件名称
'返回值:文件内容
'************** ......
废话不多说,贴代码:
先来看看ByVal传值:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim arr(2)
arr(0) = 0
arr(1) = 1
arr(2) = 2
Call sub1(arr)
Sub sub1(ByVal a)
a(0) = 9
a(1) = 8
a(2) = 7
Response.Write("我在sub过程中更改了值:"&a(0)&","&a(1)&","&a(2))
......
<div id="storyScroller" style="width:100%;height:140px;line-height:28px;overflow:hidden;">
<div id="storyScrollMid">
<ul id="storyScrollUl" style=" list-style-type:circle; list-style-position: outside; margin-left:18px; margin-right:0px">
<li>item01</l ......