Property: CompareMode for Dictionary
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: CompareMode for Dictionary
Property: CompareMode for Dictionary
Specifies how a Dictionary collection compares text keys. By default, the Dictionary collection compares text.
Object.CompareMode
| Object | Dictionary Object with this property | ||||||
| Object.CompareMode | Enumeration with read and write access and the following selection terms:
|
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)