ASP Add ਮੱਥਦਾ

ਪਰਿਭਾਸ਼ਾ ਅਤੇ ਵਰਤੋਂ

Add ਮੱਥਦਾ Dictionary ਆਬਜੈਕਟ ਨੂੰ ਨਵਾਂ key/item ਜੋੜਦਾ ਹੈ。

ਟਿੱਪਣੀਆਂ:ਜੇਕਰ key ਪਹਿਲਾਂ ਮੌਜੂਦ ਹੈ ਤਾਂ ਗਲਤੀ ਆਵੇਗੀ。

ਗਰਿੱਖਤਰ

DictionaryObject.Add(key,item)
Parameter Description
ਕੀ ਲੋੜੀਦਾ ਹੈ। ਆਈਟਮ ਨਾਲ ਜੁੜੇ ਕੀ ਕੀਮਤ
ਆਈਟਮ ਲੋੜੀਦਾ ਹੈ। ਕੀ ਨਾਲ ਜੁੜੇ ਆਈਟਮ ਕੀਮਤ

ਇੱਕ ਉਦਾਹਰਣ

<%
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"))
%>

输出:

The value of key gr is: Green