DIAdem Help

Method: Remove for Dictionary

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

Method: Remove for Dictionary

Deletes a key/element pair from a Dictionary collection.

Object.Remove(Key)
ObjectDictionary
Object with this method
KeyVariant
Specifies the key.

The following example generates a Dictionary collection and adds some key/element pairs. Then the example checks whether the key "a" exists and deletes the key accordingly:

Dim MyDic
Set MyDic = CreateObject("Scripting.Dictionary")
Call MyDic.Add ("a", "Austin")
Call MyDic.Add ("b", "Berlin")
Call MyDic.Add ("c", "Chicago")

' ... Further instructions

If MyDic.Exists("a") Then
  Call MyDic.Remove ("a")
End If

Log in to get a better experience