Metodo ASP esiste


❮ Riferimento completo agli oggetti del dizionario

Il metodo Exists restituisce un valore booleano che indica se una chiave specificata esiste nell'oggetto Dictionary. Restituisce true se la chiave esiste e false in caso contrario.

Sintassi

DictionaryObject.Exists(key)

Parameter Description
key Required. The key value to search for

Esempio

<%
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!

❮ Riferimento completo agli oggetti del dizionario