ASP ExistsMétodo
Manual de referencia completo del objeto Dictionary
El método Exists devuelve un valor booleano que indica si existe la clave especificada en el objeto Dictionary. Si existe, devuelve true; de lo contrario, devuelve false.
Sintaxis
DictionaryObject.Exists(key)
| Parámetros | Descripción |
|---|---|
| key | Obligatorio. El valor de clave que se va a buscar. |
Ejemplo
<%
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
%>
Salida:
Key exists!
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
%>
Salida:
Key exists!
Manual de referencia completo del objeto Dictionary Otras extensiones