Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bug in scripting.dictionary for VBA

Status
Not open for further replies.

christhedonstar

Programmer
Apr 9, 2007
215
GB
Anyone else noticed that when you do

myDic.item("SomethingNotExisting") it returns empty but adds an item to the dictionary?
 
That is not a bug, it is a feature.

Gerry
 
Interesting. I can not duplicate your:

myDic.item("SomethingNotExisting")

VBA returns a syntax error: "Invalid use of property."

In other words, for me, it does NOT add a new Item.

Gerry
 
I confirm this is a feature:

manual said:
If key is not found when changing an item, a new key is created with the specified newitem. If key is not found when attempting to return an existing item, a new key is created and its corresponding item is left empty.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top