DIAdem Help

Property: CompareMode for Dictionary

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

Property: CompareMode for Dictionary

Specifies how a Dictionary collection compares text keys. By default, the Dictionary collection compares text.

Object.CompareMode
ObjectDictionary
Object with this property
Object.CompareModeEnumeration with read and write access and the following selection terms:
0vbBinaryCompareBinary comparison
1vbTextCompareText comparison

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

Dim MyDic, MyKeys, MyKey, sOutput
Const BinaryCompare = 0
Const TextCompare = 1
Set MyDic = CreateObject("Scripting.Dictionary")
MyDic.CompareMode = BinaryCompare
Call MyDic.Add ("a", "Austin")
Call MyDic.Add ("A", "Aachen")
MyKeys = MyDic.Keys
For Each MyKey in MyKeys
  sOutput = sOutput & MyKey & VBCrLf
Next
Call MsgBox(sOutput)

Log in to get a better experience