Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_DictionaryEnhanced VBA Dictionary

Public Property Get ItemNoErr (
Key As String,
Optional ExpectObject As Boolean = False
) As Variant

Like Item() but if there is no element with the specified key, just returns Null rather than throwing an error.

Key as String

The key

Optional ExpectObject as Boolean = False

Expect an object, so if no object is found, Set the return value to Nothing rather than assigning it to Null

Call Template:

Dim obj As New xf_Dictionary
Dim v As Variant
v = obj.ItemNoErr(Key)
v = obj.ItemNoErr(Key, ExpectObject)

See Also:

Example 1:

Debug.Print TestDict.ItemNoErr("Nicaragua")  ' the value is scalar
Set v = TestDict.ItemNoErr("Nicaragua")      ' the value is an object
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd