# Thread: Array Dimensions (Word 97SR2)

1. ## Array Dimensions (Word 97SR2)

Is there a statement or function that returns the number of dimensions in an array?

2. ## Re: Array Dimensions (Word 97SR2)

Are you talking about the UBound of an array or the actual number of dimensions, like Dim strArray(0,1,1)?

3. ## Re: Array Dimensions (Word 97SR2)

The actual number of dimensions.

4. ## Re: Array Dimensions (Word 97SR2)

Hi Kevin,
I don't know of any built-in functions to do it, but I also can't think offhand of a situation where you wouldn't already know it or be able to figure it out another way (eg if you fill it from a range in Excel you could use the column and row counts). Do you have somehting specific in mind?

5. ## Re: Array Dimensions (Word 97SR2)

Kevin,

The only way I know is very dodgy. I don't like using On Error processing where it can be avoided. But perhaps something like:

I = 0
do
on error goto show
j = ubound(Array,i)
on error goto 0
i = i + 1
loop

exit sub

show:
msgbox "dimension is " & i

6. ## Re: Array Dimensions (Word 97SR2)

That works fine and is ok by me. In fact, that's the way Romke Solddat does it.

(I just signed up for offmagnet and downloaded his shell sort part II).

Thanks!

7. ## Re: Array Dimensions (Word 97SR2)

I was trying to create a sort routine and needed to test for the number of dimensions, but I subsequently bit the bullet as they say and signed up for offmagnet and downloaded the article and code I've been eyeing from Romke Soldat.

I won't reinvent the wheel.

8. ## Re: Array Dimensions (Word 97SR2)

Geoff & Kevin,

I have used this method but in large 2 dimensional arrays or arrays with more than 5 or 6 dimensions (depending on the number of elements per dimension) it produces an Out of Memory error, so needs caution.

Andrew

9. ## Re: Array Dimensions (Word 97SR2)

As per <A target="_blank" HREF=http://support.microsoft.com/default.aspx?scid=kb;EN-US;q197190>this MSKB article</A>?

10. ## Re: Array Dimensions (Word 97SR2)

400K with each click...

Gee wiz.

Geoff, what is it that flashes every 10 seconds or so in your sig?

11. ## Re: Array Dimensions (Word 97SR2)

It's an animated gif, just something I did when I was bored with the old one and wanted to play with Animation Shop.

"Gee Wiz"- that sounds like Gandalf.

12. ## Re: Array Dimensions (Word 97SR2)

I don't recall hearing Gandalf use that word. Has it been that long since I read the trilogy?

It's the read ff's that caught my attention. I thought you were doing some subliminal advertising for a new hair growth product or something...

13. ## Re: Array Dimensions (Word 97SR2)

I meant that Gandalf *is* the G wiz.

Nothing subliminal. I have enough trouble explaining simple things without going subliminal. It's just a flash in the name.

14. ## Re: Array Dimensions (Word 97SR2)

Ahhh, he is indeed.

15. ## Re: Array Dimensions (Word 97SR2)

Just stumbled across <A target="_blank" HREF=http://vb-tec.de/arrdim.htm>this link</A>.

<img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•