ralph
12/22/2011 2:25:00 AM
On Wed, 21 Dec 2011 16:21:23 -0500, GS <gs@somewhere.net> wrote:
>It happens that Thorsten Albers formulated :
>> GS <gs@somewhere.net> schrieb im Beitrag <jctbf4$kpb$1@dont-email.me>...
>>> What I'm looking for is a way to determine how many dims an unknown
>>> array is. Currently I use a Do...Loop with a counter that exits when a
>>> trapped error occurs. I don't think I'd ever encounter more than a 3D
>>> array, but a generic method to determine how many dims and how to get
>>> their respective ubounds is what I'm hoping someone can help me with.
>>
>> Try SafeArrayGetDim() (OLEAUT32.DLL).
>
>Thank you! I'll take a look at that function. There's really not much
>call to get this info unless a variant passed to a 3rd party component
>returns a multi-dim array. As I explained to MikeD, I currently loop
>arrays with unknown dims to do this but would like to find a better way
>to handle this task. I appreciate your input...
It depends on what you are doing with the information, but in most
cases you don't actually need to know the exact dimensions.
You can do a For...Each for each 'sub-array' and trap the error when
you advance one too far.
-ralph