You can use the ASP Dictionary Object , the example below:
<%
'//Criando o dicionário
Dim d
Set d = CreateObject("Scripting.Dictionary")
'//Adicionando os itens
d.Add "re","Red"
d.Add "gr","Green"
d.Add "bl","Blue"
d.Add "pi","Pink"
'//Recuperando e imprimindo valores
dim a,c
a = d.Keys
c = d.items
for i=0 to d.Count-1
Response.Write(a(i) + " " + c(i))
Response.Write("<br>")
next
%>
If you still want to print with For each
it can be done like this:
For each item in d.Keys
Response.Write(item + " " + d.Item(item))
Response.Write("<br>")
Next
To change some value, you must enter the key and the new value, for example:
if (d.Exists("re")) then '// verificando se a chave existe
d.Item("re") = "new valor" '// alterando valores
end if
This also follows the same template to exclude, eg:
if (d.Exists("re")) then '// verificando se a chave existe
d.Remove("re") '// excluindo item
end if
to remove all items:
d.RemoveAll