Re: To declare or not to declare
From: keepITcool (xrrcvgpbby_at_puryyb.ay)
Date: 10/29/04
- Next message: Debra Dalgleish: "Re: Advanced Filter Macro with InputBox use"
- Previous message: Harald Staff: "Re: If user says "No" to FileSaveAs Overwrite?"
- In reply to: Stephen Bullen: "Re: To declare or not to declare"
- Next in thread: Stephen Bullen: "Re: To declare or not to declare"
- Reply: Stephen Bullen: "Re: To declare or not to declare"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 29 Oct 2004 14:49:20 -0700
Stephen..
yep that makes sense to me..<g>
I saw that you've finished your new book
Professional Excel Development..
Pity I'll have to wait till FEB 4th for it's release
I've just run a few tests:
(For the purpose of finding unique items)
the Collection and the Dictionary
add items at practically the same speed.
One advantage of using a Dictionary would be that
the Dictionary can return a 0based array, (either items or keys)
whereas for the dictionary this array must created.
IF you need a 1 dimensional array of unique items
the dictionary is up to 50% faster than the collection.
(plus you have CaseSensitivity!)
======================================================
For the dictionary: on error resume next
works slightly faster then using .Exists(key)
before adding the itm.
tests done with a latebound dictionary
If you DONT need to return an array.. and prefer to "keep" the object..
the dictionary has a few other advantages like being able to CHANGE the
key.
Does it have any DISADVANTAGE?
1 I've heard that some companies disable scripting...
2 ??
keepITcool
< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
Stephen Bullen <stephen@oaltd.co.uk> wrote:
> Hi KeepITcool,
>
>> compensating for the performance loss of creating the non native
>> dictionary.
>
> FWIW, I don't think either the Collection or the Dictionary are
> 'native', so there's no performance loss. The Collection object is
> provided by the VBA library that our projects reference, while the
> Dictionary object is provided by the Scripting library that our
> projects (can) reference. The only difference is that the VBA library
> is already referenced for us by default in our projects.
>
> Regards
>
> Stephen Bullen
> Microsoft MVP - Excel
> www.oaltd.co.uk
>
>
>
- Next message: Debra Dalgleish: "Re: Advanced Filter Macro with InputBox use"
- Previous message: Harald Staff: "Re: If user says "No" to FileSaveAs Overwrite?"
- In reply to: Stephen Bullen: "Re: To declare or not to declare"
- Next in thread: Stephen Bullen: "Re: To declare or not to declare"
- Reply: Stephen Bullen: "Re: To declare or not to declare"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|