Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Number of dimensions in an array?

6 views
Skip to first unread message

Ben

unread,
Jul 12, 2001, 2:42:05 PM7/12/01
to
Hi,

Is there a way to find out how many dimensions an array has? LBound and
UBound tell you how many elements are within a given dimension but I want to
know how many dimensions there are in an array.

Thanks
ben


Michael Harris

unread,
Jul 12, 2001, 8:27:13 PM7/12/01
to
Here's a quick hack...

dim foo(1,1,1)

on error resume next
for n = 0 to 999
x = ubound(foo,n+1)
if err then exit for
next
on error goto 0
msgbox "foo has " & n & " dimensions"


--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--

"Ben" <bbsha...@hotmail.com> wrote in message news:Oen8ZJwCBHA.408@tkmsftngp05...

0 new messages