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 = msg
End Function
Exists 方法
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]
相关文章:
- VolumeName 属性(2007-11-25 9:35:44)
- ShareName 属性(2007-11-14 8:22:48)
- Drive 属性(2007-10-25 7:12:0)
- DriveType 属性(2007-10-24 10:48:23)
- TotalSize 属性(2007-9-19 3:33:40)
- DateLastAccessed 属性(2007-9-3 8:39:21)
- DriveExists 方法(2007-7-23 5:33:35)
- BuildPath 方法(2007-6-2 10:33:55)
- Copy 方法(2007-5-2 3:30:45)
- Line 属性(2007-2-9 1:43:32)
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
