DIAdem Help

Method: Keys for Dictionary

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

Method: Keys for Dictionary

Returns an array with the keys of a Dictionary collection.

vKeys = Object.Keys
ObjectDictionary
Object with this method
vKeysVariant
Receives the array with the keys.

The following example generates a Dictionary collection and adds some key/element pairs. Then the example displays the list of all keys:

Dim MyDic, MyKeys, MyKey, sOutput
Set MyDic = CreateObject("Scripting.Dictionary")
Call MyDic.Add ("a", "Austin")
Call MyDic.Add ("b", "Berlin")
Call MyDic.Add ("c", "Chicago")
MyKeys = MyDic.Keys
For Each MyKey in MyKeys
  sOutput = sOutput & MyKey & VBCrLf
Next
Call MsgBox(sOutput)

Log in to get a better experience