ASP存在メソッド
❮完全な辞書オブジェクトリファレンス
Existsメソッドは、指定されたキーがDictionaryオブジェクトに存在するかどうかを示すブール値を返します。キーが存在する場合はtrueを返し、存在しない場合はfalseを返します。
構文
DictionaryObject.Exists(key)
Parameter | Description |
---|---|
key | Required. The key value to search for |
例
<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n","Norway"
d.Add "i","Italy"
d.Add "s","Sweden"
if d.Exists("n")=true then
Response.Write("Key exists!")
else
Response.Write("Key does not exist!")
end if
set d=nothing
%>
Output:
Key exists!
❮完全な辞書オブジェクトリファレンス