DIAdem Help

Property: Key for Dictionary

  • Updated2024-09-12
  • 1 minute(s) read

Property: Key for Dictionary

Specifies the key for a Dictionary collection.

Object.Key(Key)
ObjectDictionary
Object with this property
KeyVariant
Specifies the key.
Object.KeyVariant with read and write access

The following example generates a Dictionary collection and adds some key/element pairs. Then the example renames the key to "b" and displays the element that belongs to the new key "MyB":

Dim MyDic, MyItem
Set MyDic = CreateObject("Scripting.Dictionary")
Call MyDic.Add ("a", "Austin")
Call MyDic.Add ("b", "Berlin")
Call MyDic.Add ("c", "Chicago")
MyDic.Key("b") = "MyB"
MyItem = MyDic.Item("MyB")
Call MsgBox("Item MyB: " & MyItem)

Log in to get a better experience