<div dir="ltr"><div>There rarely are good answers to questions like that without seeing the code. But it seems I would use the normal dynamic object arrays.</div><div></div><div>Dim hArr As New Object[]</div><div><br></div><div>Fill the array with null objects up to known biggest value.</div><div>hArr.Insert(hTempArr.Resize(iBiggestValue))<br></div><div><br></div><div>And then just add the object. Unless the value is already within the max index, then just add.<br></div><div><br></div><div><br></div><div>Jussi<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 9, 2020 at 12:38 AM Bruce <<a href="mailto:adamnt42@gmail.com">adamnt42@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Much existing code uses the (full) array. The sparse situation occurs <br>
perhaps <5% of the time and represents "changes" to the existing set <br>
already present in the full array. I suppose that I could detect that <br>
the incoming messages represent changes and handle that as a temporary <br>
collection but then I'd have to clone and modify many methods that <br>
already exist in both applications and libraries (with the concomitant <br>
danger to both the current development and the ongoning support...<br>
<br>
The damn problem is that I cant process the change messages one by one, <br>
the entire set of original objects is affected by the entire set of <br>
changes.  And the changes must be done in an atomic sense because while <br>
one change set is building another (different) change set may start to <br>
arrive. Grrrr.<br>
b<br>
<br>
On 9/3/20 5:06 am, Jussi Lahtinen wrote:<br>
> Can you open bit more why using collection is out of the question?<br>
> <br>
> Jussi<br>
> <br>
> On Sun, Mar 8, 2020 at 7:16 AM Bruce <<a href="mailto:adamnt42@gmail.com" target="_blank">adamnt42@gmail.com</a> <br>
> <mailto:<a href="mailto:adamnt42@gmail.com" target="_blank">adamnt42@gmail.com</a>>> wrote:<br>
> <br>
>     Firstly, I haven't tried this but I was wondering if it is possible.<br>
> <br>
>     Given a set of objects that have an ordinal characteristic (not a<br>
>     property of the object itself and not encountered in the ascending<br>
>     order<br>
>     of that characteristic) is it possible to construct an array of such<br>
>     objects that is only sparsely populated?<br>
> <br>
>     Let's say we have the following objects, with that derived<br>
>     characteristic in brackets: Ahab(3),Chab(6), Fhab(2) and Ghab(7).<br>
>     I want to fill the array such that its' final representation is<br>
>     [0] -<br>
>     [1] -<br>
>     [2] Fhab<br>
>     [3] Ahab<br>
>     [4] -<br>
>     [5] -<br>
>     [6] Chab<br>
>     [7] Ghab<br>
> <br>
>     I don't know at the outset what the maximum ordinal value is and so I<br>
>     don't know the size of the array.<br>
>     There are reasons for using an array rather than a collection keyed by<br>
>     the value.<br>
>     The source of the objects is unsortable, they arrive over time in a<br>
>     random order.<br>
> <br>
>     Any thoughts?<br>
>     b<br>
> <br>
>     p.s. It's like the IP layer in TCP/IP putting the packets back in order<br>
>     to rebuild the entire message.<br>
> <br>
>     ----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
> <br>
> <br>
> <br>
> ----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
> <br>
<br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
</blockquote></div>