View Single Post
  #27   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Reduce duplicates to 1 with a count of how many before

Hi Garry,

Am Sat, 22 Feb 2014 22:24:39 -0500 schrieb GS:

Thanks.., I see that now though I don't see the why of it!


in the macro Test_CB2 I had no Option Base 1. But in the other macros
I had.
If I have 1D-Arrays (like the Scripting.Dictionary) into the code and
want to create 2D-Arrays out of them for me it seems easier to handle
with Option Base 1.
Now I have changed all codes (SkyDrive) to Option Base 0. ;-)


Regards
Claus B.


Hi Claus,
That makes sense to me but I found it to be problematic when the module
also required zero-based arrays that dealt with control indexes OR
recordsets from delimited text files where field names were the 1st
line in the file. If missing fieldnames I'd have to prepend a line to
the file contents before splitting into an array so the 1st record is
always 1 and the record count is always UBound.

What I find when working with 1D/2D arrays is that using a separate
counter works best for building the output array while the loop counter
starts at LBound. This allows easy transition going either way, IMO.<g

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion