Metode Keys ASP

Definisi dan Penggunaan

Metode Keys mengembalikan sebuah array yang mengandung semua key dalam objek Dictionary.

Sintaks:

DictionaryObject.Keys

Contoh

<%
dim d,a,i
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "c","China"
d.Add "i","Italy"
d.Add "s","Sweden"
Response.Write("<p>Values Kunci:</p>")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("<br />")
next
set d=nothing
%>

Output:

Nilai kunci:
c
i
s