Método existe ASP
❮ Referência Completa do Objeto do Dicionário
O método Exists retorna um valor booleano que indica se uma chave especificada existe no objeto Dictionary. Retorna true se a chave existir e false se não existir.
Sintaxe
DictionaryObject.Exists(key)
Parameter | Description |
---|---|
key | Required. The key value to search for |
Exemplo
<%
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!
❮ Referência Completa do Objeto do Dicionário