IsArray
VBScript IsArray 函数
IsArray 函数返回一个指示指定的变量是否为数组的布尔值。如果变量为数组,则返回 True,否则返回 False。
语法
IsArray(variable)
参数 | 描述 |
---|---|
variable | 必需。任何变量。 |
实例
实例 1
<script type="text/vbscript">
days=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
document.write(IsArray(days))
</script>
days=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
document.write(IsArray(days))
</script>
以上实例输出结果:
True
实例 2
<script type="text/vbscript">
Dim a(5)
a(0)="Saturday"
a(1)="Sunday"
a(2)="Monday"
a(3)="Tuesday"
a(4)="Wednesday"
document.write(IsArray(a))
</script>
Dim a(5)
a(0)="Saturday"
a(1)="Sunday"
a(2)="Monday"
a(3)="Tuesday"
a(4)="Wednesday"
document.write(IsArray(a))
</script>
以上实例输出结果:
True
实例 3
<script type="text/vbscript">
a="Saturday"
document.write(IsArray(a))
</script>
a="Saturday"
document.write(IsArray(a))
</script>
以上实例输出结果:
False