Re: Does VB have something that can return just a column of a multi-column array?

Tech-Archive recommends: Fix windows errors by optimizing your registry



That sounds neat. A 1-dim array of pointers to the second column of the
multi-dim array A Interesting. Thanks for the tip.

--

George Hester
_________________________________
"Jim Mack" <jmack@xxxxxxxxxxxxxxx> wrote in message
news:eHkwb5f2IHA.5728@xxxxxxxxxxxxxxxxxxxxxxx
George Hester wrote:
I would like to access just one dimension of a multi-column and
rows array. Something like if A(i,j) is an array with values for i
and j how about A(I,j) being just a one-dimensional array? I could
be say the number of elements i. Thanks.

VB doesn't natively allow that, but it's possible to fool VB into
thinking it does, depending on how the array is ordered. But it's a
hack, and has to be approached carefully.

Basically, the idea is to create a blank single-dim array, and
manipulate its SafeArray structure to have the correct bounds, and a
pointer to the data of interest.

It's not for the inexperienced or the careless, though. You can get
things bollixed up pretty well if you miss a step, or do something you
shouldn't.

--
Jim Mack
MicroDexterity Inc
www.microdexterity.com



.



Relevant Pages

  • Re: Differance between Array and Pointers
    ... Well, except that arrays tend to be much larger than pointers, and the ... An array is a contiguous region of memory containing N elements of M ... indexing vs. a loop). ...
    (comp.arch.embedded)
  • [RFCv2][PATCH] flexible array implementation
    ... I call it a flexible array. ... storage for pointers to the second level. ... all locking must be provided by the caller. ... make sure to pass in &ptr instead of ptr. ...
    (Linux-Kernel)
  • Re: [RFCv2][PATCH] flexible array implementation
    ... I call it a flexible array. ... storage for pointers to the second level. ... all locking must be provided by the caller. ... make sure to pass in &ptr instead of ptr. ...
    (Linux-Kernel)
  • [RFC][PATCH] flexible array implementation v4
    ... I call it a flexible array. ... so never does an order>0 allocation. ... storage for pointers to the second level. ... all locking must be provided by the caller. ...
    (Linux-Kernel)
  • Re: [RFC][PATCH] flexible array implementation v4
    ... I call it a flexible array. ... so never does an order>0 allocation. ... storage for pointers to the second level. ... all locking must be provided by the caller. ...
    (Linux-Kernel)