ASP วิธีการที่มีอยู่
❮ การอ้างอิงวัตถุพจนานุกรมที่สมบูรณ์
วิธีการที่มีอยู่ส่งกลับค่าบูลีนที่ระบุว่ามีคีย์ที่ระบุอยู่ในวัตถุพจนานุกรม คืนค่า true หากมีคีย์ และคืนค่า false หากไม่มี
ไวยากรณ์
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!
❮ การอ้างอิงวัตถุพจนานุกรมที่สมบูรณ์