DIAdem Help

Property: Count for Dictionary

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

Property: Count for Dictionary

Counts all key/element pairs from a Dictionary collection.

Object.Count
ObjectDictionary
Object with this property
Object.CountLongInteger with read access

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, sOutput, i
Set MyDic = CreateObject("Scripting.Dictionary")
Call MyDic.Add ("a", "Austin")
Call MyDic.Add ("b", "Berlin")
Call MyDic.Add ("c", "Chicago")
MyKeys = MyDic.Keys
For i = 0 to MyDic.Count-1
  sOutput = sOutput & MyKeys(i) & VBCrLf
Next
Call MsgBox(sOutput)

Log in to get a better experience