You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a dictionary with multiple object keys, if I remove one of these keys, then the values associated with the object keys added after the removed one "shift down", with the value of the object key added immediately after the removed key becoming Empty. See:
PublicSubDictionaryTest()
Dim dict AsNew Dictionary
Dim key1 AsNew Dictionary 'or any other initialized objectDim key2 AsNew Dictionary 'or any other initialized objectDim key3 AsNew Dictionary 'or any other initialized object
dict(key1) = 1
dict(key2) = 2
dict(key3) = 3
Debug.Print dict(key3) = 3'prints True
Debug.Print dict(key3) = 2'prints False
Debug.Print dict(key2) = 2'prints True
Debug.Print IsEmpty(dict(key2)) 'prints False
dict.Remove key1
Debug.Print dict(key3) = 3'prints False!
Debug.Print dict(key3) = 2'prints True!
Debug.Print dict(key2) = 2'prints False!
Debug.Print IsEmpty(dict(key2)) 'prints True!End Sub
I think that this is because of how dictionaries internally map object keys to a string representation based on their index in dict_pObjectKeys. When one object is removed from this collection, the indices of the other objects automatically shift down, changing their string representations and resulting in this bug.
The text was updated successfully, but these errors were encountered:
Given a dictionary with multiple object keys, if I remove one of these keys, then the values associated with the object keys added after the removed one "shift down", with the value of the object key added immediately after the removed key becoming
Empty
. See:I think that this is because of how dictionaries internally map object keys to a string representation based on their index in
dict_pObjectKeys
. When one object is removed from this collection, the indices of the other objects automatically shift down, changing their string representations and resulting in this bug.The text was updated successfully, but these errors were encountered: