当前位置: 首页 > 网络学院 > 客户端脚本教程 > VBScript > VBScript 关键字

VBScript
VBScript 介绍
如何使用 VBScript
VBScript 放置
VBScript 变量
VBScript 程序
VBScript 条件语句
VBScript 循环声明
VBScript 摘要
VBScript 实例
VBScript 函数
VBScript 关键字

VBScript 关键字


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 525 ::
收藏到网摘: n/a

VBScript 关键字

关键字 描述
empty

Used to indicate an uninitialized variable value. A variable value is uninitialized when it is first created and no value is assigned to it, or when a variable value is explicitly set to empty.
用于指明未初始化的变量值。

举例:
dim x   'x变量未初始化
x="ff"   'x已经不再是未初始化的变量了
x=empty   'x为初始化变量

Note: This is not the same as Null!!
注意:这和Null不同

isEmpty

Used to test if a variable is uninitialized.
用来测试变量是否为初始化

举例: If (isEmpty(x)) 'x是否为初始化变量?

nothing Used to indicate an uninitialized object value, or to disassociate an object variable from an object to release system resources.
在 VBScript 中,Nothing 关键字用于取消某对象变量与实际对象的关联。

举例: set myObject=nothing

is nothing Used to test if a value is an initialized object.
用来测试对象有无初始化

举例: If (myObject Is Nothing) '它是否建立?

注意: If you compare a value to Nothing, you will not get the right result! Example: If (myObject = Nothing) 'always false!
如果你将值与Nothing做比较,将不会得到正确的结果!

null Used to indicate that a variable contains no valid data.
Null 关键字用于指明变量包含的数据无效

One way to think of Null is that someone has explicitly set the value to "invalid", unlike Empty where the value is "not set".
对于“null”有一种解释方式为它被明确设置这个值为“无效”,而不像“Empty ”它的值为“not set”(没有被设定)

Note: This is not the same as Empty or Nothing!!
注意:null并不和Empty或 Nothing一样!

Example: x=Null 'x contains no valid data

isNull Used to test if a value contains invalid data.
用来测试包含的是否为有效数据

Example: if (isNull(x)) 'is x invalid?

true Used to indicate a Boolean condition that is correct (true has a value of -1)
True 关键字的值等于 -1。
false Used to indicate a Boolean condition that is not correct (false has a value of 0)
False 关键字的值为零。

评论 (0) All

登陆 | 还没注册?