0 Members and 1 Guest are viewing this topic.
function TestCompareMode(key){ // Create some variables. var a, d; var BinaryCompare = 0, TextCompare = 1; d = new ActiveXObject("Scripting.Dictionary"); // Set Compare mode to Text. d.CompareMode = TextCompare; // Add some keys and items. d.Add("a", "Athens"); d.Add("b", "Belgrade"); d.Add("c", "Cairo"); return(d.Item(key));}
Dim dSet d = CreateObject("Scripting.Dictionary")d.CompareMode = vbTextCompared.Add "a", "Athens" ' Add some keys and items.d.Add "b", "Belgrade"d.Add "c", "Cairo"d.Add "B", "Baltimore" ' Add method fails on this line because the ' letter b already exists in the Dictionary.
DIM d AS IDictionaryDIM vKey AS VARIANTDIM vItem AS VARIANTd = NEWCOM "Scripting.Dictionary"d.CompareMode = %CompareMethod_TextComparevKey = "a" : vItem = "Athens"d.Add vKey, vItemvKey = "b" : vItem = "Belgrade"d.Add vKey, vItemvKey = "c" : vItem = "Cairo"d.Add vKey, vItem' Add method fails on this line because the ' letter b already exists in the Dictionary.vKey = "B" : vItem = "Baltimore"d.Add vKey, vItem