طريقة ASP موجودة
❮ استكمال مرجع كائن القاموس
تقوم طريقة Exists بإرجاع قيمة منطقية تشير إلى وجود مفتاح محدد في كائن القاموس. يعود صحيحًا إذا كان المفتاح موجودًا ، وخطأ إذا لم يكن كذلك.
بناء الجملة
DictionaryObject.Exists(key)
Parameter | Description |
---|---|
key | Required. The key value to search for |
مثال
<%
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!
❮ استكمال مرجع كائن القاموس