当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > VBS教程:方法-Exists 方法

VBScript
VBS教程:函数-TimeSerial 函数
VBS教程:函数-Timer 函数
VBS教程:函数-Time 函数
VBS教程:函数-Tan 函数
VBS教程:函数-StrReverse 函数
VBS教程:函数-String 函数
VBS教程:函数-StrComp 函数
VBS教程:函数-Sqr 函数
VBS教程:函数-Split 函数
VBS教程:函数-Space 函数
VBS教程:函数-Sin 函数
VBS教程:函数-Sgn 函数
VBS教程:函数-SetLocale 函数
VBS教程:函数-Second 函数
VBS教程:函数-ScriptEngineMinorVersion 函数
VBS教程:函数-ScriptEngineMajorVersion 函数
VBS教程:函数-Mid 函数
VBS教程:函数-数学函数
VBS教程:函数-LTrim、RTrim 和 Trim 函数
VBS教程:函数-Log 函数

VBScript 中的 VBS教程:方法-Exists 方法


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

Exists 方法

如果在 Dictionary 对象中存在指定键,返回 True;如果不存在,返回 False

object.Exists(key)

参数

object

必选项. 总是 Dictionary 对象名称。

key

必选项. 在Dictionary 对象中查找的Key 值。

说明

下面例子举例说明如何使用Exists 方法:

 Function KeyExistsDemo Dim d, msg '创建一些变量。 Set d = CreateObject("Scripting.Dictionary") d.Add "a", "Athens" '添加一些键和项目。 d.Add "b", "Belgrade" d.Add "c", "Cairo" If d.Exists("c") Then msg = "指定的键存在。" Else msg = "指定的键不存在。" End If KeyExistsDemo = msgEnd Function

请参阅