VarType

收藏:0   阅读:22

VBScript VarType 函数


VarType 函数返回指示指定变量的子类型的值。

VarType 函数返回下面的值:

注意:假如变量是数组,则 VarType() 会返回 8192 + VarType(array_element)。举例:整数数组的 VarType() 会返回 8192 + 2 = 8194。

语法

VarType(varname)

参数 描述
varname 必需。变量的名称。

实例

<script type="text/vbscript">

x="Hello World!"
document.write(VarType(x) & "<br />")
x=4
document.write(VarType(x) & "<br />")
x=4.675
document.write(VarType(x) & "<br />")
x=Null
document.write(VarType(x) & "<br />")
x=Empty
document.write(VarType(x) & "<br />")
x=True
document.write(VarType(x))

</script>

以上实例输出结果:

8
2
5
1
0
11

© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!