YouTip LogoYouTip

Met Exists

ASP Exists Method |

-- Learning is not just about technology, but also about dreams!

ASP Tutorial

ASP Tutorial ASP Introduction ASP Installation ASP Syntax ASP Variables ASP Procedures ASP Forms ASP Cookies ASP Session ASP Application ASP #include ASP Global.asa ASP Send Email

ASP Objects

ASP Response ASP Request ASP Application ASP Session ASP Server ASP Error ASP FileSystem ASP TextStream ASP Drive ASP File ASP Folder ASP Dictionary ASP ADO

ASP Components

ASP AdRotator ASP BrowserCap ASP Content Linking ASP Content Rotator

ASP and AJAX

AJAX Introduction AJAX ASP AJAX Database

ASP Summary

ASP Quick Reference ASP Summary

ASP Examples

ASP Examples

ASP Folder Object

ASP ADO

ASP Exists Method


Dictionary Object Reference Complete Dictionary Object Reference


The Exists method returns a Boolean value indicating whether a specified key exists in the Dictionary object. If it exists, it returns true; otherwise, it returns false.

Syntax

DictionaryObject.Exists(key)
Parameter 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

← Met ItemsMet Add β†’