假如 Dictionary 对象中存在所指定的主键则返回 true,否则返回 false。
object.Exists(key)
object
必选项。总是一个 Dictionary 对象的名称。
key
必选项。需要在 Dictionary 对象中搜索的 key 值。
下面这个例子说明了 Exists 方法的用法。
function keyExists(k){var fso, s = "";d = new ActiveXObject("Scripting.Dictionary");d.Add("a", "Athens");d.Add("b", "Belgrade");d.Add("c", "Cairo");if (d.Exists(k))s += "Specified key exists.";elses += "Specified key doesn't exist.";return(s);}
Add 方法 (Dictionary) Items 方法 Keys 方法 Remove 方法 RemoveAll 方法应用于: Dictionary 对象
新闻热点
疑难解答