Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP Exists Method

ASP Exists Method


Dictionary Object Reference 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!


Dictionary Object Reference Complete Dictionary object reference manual