我是在做一个考试系统,其中要求按百分比随机确定参加考试人员名单我写了以下代码;
<%function differ(test,temp,count,i)
if i=1 then y=1 else y=i-1
for x=1 to y
if temp=test(x) then
temps=fix(count*rnd)
differ test,temps,count,i
temp=temps
end if
next
differ=temp
end function
for i=1 to count
sqlstr="select * from cadre_info where department='"&trim(department(a))&"'"
set rs=server.createobject("adodb.recordset")
rs.open sqlstr,conn,3,2
counts=rs.recordcount
temp=fix(counts*rnd)
test(i)=differ(test,temp,counts,i)
//response.write test(i)&"*<bR>"
rs.move test(i)
next%>
出现如下错误:
Microsoft VBScript 运行时错误 (0x800A001C)
堆栈溢出: 'differ'
错误在 differ test,temps,count,i