ASP AddMétodo
Manual de referencia completo del objeto Dictionary
El método Add agrega un nuevo par key/item al objeto Dictionary.
Nota:Si la key ya existe, se producirá un error.
Sintaxis
DictionaryObject.Add(key,item)
| Parámetros | Descripción |
|---|---|
| key | Requerido. El valor de key asociado con el item. |
| item | Requerido. El valor de item asociado con la key. |
Ejemplo
<%
Dim d
Set d=Server.CreateObject("Scripting.Dictionary")
d.Add "re","Red"
d.Add "gr","Green"
d.Add "bl","Blue"
d.Add "pi","Pink"
Response.Write("The value of key gr is: " & d.Item("gr"))
%>
Salida:
The value of key gr is: Green
Dim d
Set d=Server.CreateObject("Scripting.Dictionary")
d.Add "re","Red"
d.Add "gr","Green"
d.Add "bl","Blue"
d.Add "pi","Pink"
Response.Write("The value of key gr is: " & d.Item("gr"))
%>
Salida:
The value of key gr is: Green
Manual de referencia completo del objeto Dictionary Otras extensiones