ASP Addメソッド


Dictionary 对象参考手册完全な Dictionary オブジェクトリファレンス

Add メソッドは、Dictionary オブジェクトに新しい key/item ペアを追加します。

注意:key がすでに存在する場合は、エラーが発生します。

構文

DictionaryObject.Add(key,item)

パラメータ 説明
key 必須です。item に関連付けられた key 値。
item 必須です。key に関連付けられた item 値。


例

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


Dictionary 对象参考手册完全な Dictionary オブジェクトリファレンス その他の拡張