Exists 方法
作者:问天 发表时间:2007-2-15 00:52 阅读:330次 在百度搜索相关内容

如果 Dictionary 对象中存在所指定的主键则返回 true,否则返回 false
[color=#FFFFFF'][/color]

object.Exists(key)
[color=#FFFFFF'][/color]

参数
object
必选项。总是一个 Dictionary 对象的名称。
key
必选项。需要在 Dictionary 对象中搜索的 key 值。
下面这个例子说明了 Exists 方法的用法。
[color=#FFFFFF'][/color]
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.";
else
s = "Specified key doesn't exist.";
return(s);
}
请参阅
Add 方法 (Dictionary)Items 方法Keys 方法Remove 方法RemoveAll 方法应用于: Dictionary 对象
[color=#FFFFFF'][/color]

#Advertisement