dhSortedDictionary empty key error msg = Object variable or With block variable not set 
Author Message
 dhSortedDictionary empty key error msg = Object variable or With block variable not set

Olaf,
thanks again for giving the community this great tool.  I just love it to
pieces
:-)

but...<g>...this one had me scratching my head for a while!
calling the .Add method
I kept getting the error msg "object variable not set...."

 i confirmed and reconfirmed that the sortedDict object did in fact exist...
it drove me crazy for an hour or so till i finally figured out the key was
an empty string variable
even a blank string will work but not an uninitialized string variable

Err <91>  <dhSortedDictionary> (Object variable or With block variable not
set)

Dim o As cSortedDictionary
Set o = New cSortedDictionary
Dim blankString As String

o.Add "", "Something"
 "Ok that worked"

o.Add blankString, "Something"
 "oops that didnt' work"

so, at least now that i know, i'll remember next time i hope
the error message was just a little confusing to me.
so i just post this for the benefit of future users that might get the same
mesage and be as brain dead as i was to not realize what I was doing
wrong...

Thanks again for the fantastic tool!
mark



Sun, 19 Jun 2011 11:53:00 GMT  
 dhSortedDictionary empty key error msg = Object variable or With block variable not set



Quote:
> o.Add blankString, "Something"
>  "oops that didnt' work"

Yep, I've found this bug myself recently, whilst writing
the new dhRichClient-Class 'cCollection' (which includes
also the sorted Key-approach from cSortedDictionary,
but also keeps its items in Add-Order, offering both item-
access-methods then (the SortedKey-access or -enumeration
in 'KeyOrder' too).

So that is already fixed in the new, upcoming component
(in both 'Collection'-Classes of course) - so, sorry for that
(it was a simple Str-NullPointer-issue, which I've not expected,
respective checked for til now).

Olaf



Mon, 20 Jun 2011 11:06:16 GMT  
 dhSortedDictionary empty key error msg = Object variable or With block variable not set


Quote:



>> o.Add blankString, "Something"
>>  "oops that didnt' work"
> Yep, I've found this bug myself recently, whilst writing
> the new dhRichClient-Class 'cCollection' (which includes
> also the sorted Key-approach from cSortedDictionary,
> but also keeps its items in Add-Order, offering both item-
> access-methods then (the SortedKey-access or -enumeration
> in 'KeyOrder' too).

> So that is already fixed in the new, upcoming component
> (in both 'Collection'-Classes of course) - so, sorry for that
> (it was a simple Str-NullPointer-issue, which I've not expected,
> respective checked for til now).

> Olaf

Thanks, look forward to seeing that.
I'll be more careful about using the right variables as keys in the future
too
:-)
Mark


Thu, 23 Jun 2011 10:31:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Error msg: Object variable or With block variable not set

2. Object variable or With block variable not set (Error 91)

3. error 91 Object Variable o on with block variable is not set

4. Runtime error 91/Object variable or With block variable not set problems

5. Object variable or With block variable not set error in Class

6. runtime error: 91 Object variable or with block variable not set

7. Object variable or With block variable not set (Error 91) Please Help

8. Run Time Error 91: Object variable or With Block variable not set

9. VB 5.0 - Error:91 Object Variable Or With Block Variable Not Set

10. Error: Object variable or with block variable not set

11. Object variable or With block variable not set (Error 91)

12. Error 91 Object variable or With-Block, variable not set

 

 
Powered by phpBB® Forum Software