在ASP中怎样判断一个变量是字符型还是数值型?

来源:百度知道 编辑:UC知道 时间:2024/05/22 15:34:31
就是在下面在代码中,在第五行判断cj的类型是字符还是数值,若是字符则提示错误并退出...或直接用循环控制输入,知道输入的是数值型的为止
问题就是怎么判断cj是数值型还是字符型了
<html><body>
<Script language="VBScript">
Dim cj
cj=InputBox("请输入分数:")
'if ISSting(cj) then Msgbox("请输入数字信息!") end if
'就是在这个位置判断cj是字符型还是数值型,若字符型则结束程序...
if cj>100 or cj<0 then
MsgBox("您输入的信息有误")
elseif cj>=91 and cj<=100 then
MsgBox("优秀")
elseif cj>=81 and cj<=90 then
MsgBox("中上")
elseif cj>=71 and cj<=80 then
MsgBox("中等")
elseif cj>=61 and cj<=70 then
MsgBox("合格")
else
MsgBox("不合格")
end if
</script>
</body></html>
对了,补充个问题,有谁知道有比较专业的ASP论坛,推荐一个啊...

if not isnumeric(cj) then Msgbox("请输入数字信息!")

ASP的论坛去www.cndw.com,动网论坛看看吧。

if isnumber(s)=false then
msgbox("请输入数字!")
end if

csdn.net