If you examine the entry in the dictionary with a key of "What???"
then naturally an entry must be created in the dictionary in order to show you that entry.
If you want to just check whether an entry exists, then perform a watch on iDict.Exists("What???")
.
Adding a watch is operating no differently to the following code:
Sub DictTest()
Dim iDict As Object
Dim i As Integer
Dim strArr() As String
Set iDict = CreateObject("Scripting.Dictionary")
strArr = Split("Why does this happen ? Why does this happen over and over ?", " ")
For i = LBound(strArr) To UBound(strArr)
iDict(strArr(i)) = strArr(i)
Next
MsgBox "The value of the 'What???' entry in iDict is '" & iDict("What???") & "'"
End Sub
This changing of the contents of a Dictionary object is no different to using the Watch Window to change the value of x
in the following situation:
In the above code, I used the watch window to edit the value of x
from 5
to 10
prior to the Debug.Print
statement.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…