VBS教程:方法-Exists 方法

所属分类: 脚本专栏 / vbs 阅读数: 644
收藏 0 赞 0 分享

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

请参阅

更多精彩内容其他人还在看

VBS教程:函数-LCase 函数

VBS教程:函数-LCase 函数
收藏 0 赞 0 分享

VBS教程:函数-LBound 函数

VBS教程:函数-LBound 函数
收藏 0 赞 0 分享

VBS教程:函数-Join 函数

返回一个字符串,此字符串由包含在数组中的许多子字符串联接创建
收藏 0 赞 0 分享

VBS教程:函数-IsObject 函数

VBS教程:函数-IsObject 函数
收藏 0 赞 0 分享

VBS教程:函数-IsNumeric 函数

VBS教程:函数-IsNumeric 函数
收藏 0 赞 0 分享

VBS教程:函数-IsNull 函数

VBS教程:函数-IsNull 函数
收藏 0 赞 0 分享

VBS教程:函数-IsEmpty 函数

VBS教程:函数-IsEmpty 函数
收藏 0 赞 0 分享

VBS教程:函数-IsDate 函数

VBS教程:函数-IsDate 函数
收藏 0 赞 0 分享

VBS教程:函数-IsArray 函数

VBS教程:函数-IsArray 函数
收藏 0 赞 0 分享

VBS教程:函数-Int、Fix 函数

VBS教程:函数-Int、Fix 函数
收藏 0 赞 0 分享
查看更多