<%
dim a
a="12.8d52d"
'a="25627"
t1=timer()
for j=0 to 10000*1
t=checknum(a,len(a))
next
t2=timer()
response.write "执行时间"&t2-t1&"<BR>"
if checknum(a,len(a)) then
response.write "纯正数字"
else
response.write "非纯正数字"
end if
'主函数,判断一串字符是否全由数字组成,调用子函数check判断。
Function checknum(a,g)
for i=1 to g-1
if check(mid(a,i,1))=false then
exit for
end if
next
checknum=check(mid(a,g,1))
End Function
'子函数,判断一个字符是否为数字
Function check(b)
if instr(1,"0123456789.",b,1)=0 then
check=false
else
check=true
end if
End Function
%>