当前位置: 代码迷 >> ASP >> 一个关于随机函数的有关问题
  详细解决方案

一个关于随机函数的有关问题

热度:191   发布时间:2012-02-12 17:16:34.0
一个关于随机函数的问题
总是调用不出来,烦死了~~~
代码如下,请高手看那里有问题
<%
Function   RndTxt(qq)
i=Int(Rnd()*9)+1
Select   Case   i
Case   1
qq   =   "a "
Case   2
qq   =   "aa "
Case   3
qq   =   "aaa "
Case   4
qq   =   "aaaa "
Case   5
qq   =   "aaaaa "
Case   6
qq   =   "aaaaaa "
Case   7
qq   =   "aaaaaaa "
Case   8
qq   =   "aaaaaaaa "
Case   9
qq   =   "aaaaaaaaa "
End   Select

End   Function
> %
mark= " <%=qq%> "

------解决方案--------------------
<%
Function RndTxt(qq)
randomize
i=Int(Rnd()*9)+1
Select Case i
Case 1
qq = "a "
Case 2
qq = "aa "
Case 3
qq = "aaa "
Case 4
qq = "aaaa "
Case 5
qq = "aaaaa "
Case 6
qq = "aaaaaa "
Case 7
qq = "aaaaaaa "
Case 8
qq = "aaaaaaaa "
Case 9
qq = "aaaaaaaaa "
End Select
RndTxt=qq
End Function
%>
mark= <% =RndTxt(0) %>
  相关解决方案