ASP Exists Method
Complete Dictionary object reference manual
The Exists method returns a Boolean value indicating whether a specified key exists in the Dictionary object. It returns true if it exists, otherwise false.
Syntax
DictionaryObject.Exists(key)
| Parameters | Description |
|---|---|
| key | Required. The key value to search for. |
Example
<%
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!
Complete Dictionary object reference manual