用户登录
用户注册

分享至

VBS教程:方法-Exists 方法

  • 作者: 她爱他56756314
  • 来源: 51数据库
  • 2021-08-14

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

请参阅

软件
前端设计
程序设计
Java相关