当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS教程:方法-Exists 方法

VBS教程:方法-Exists 方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

神马网站,菌类,ed2k 泷泽萝拉

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

请参阅

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网