Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Array Dimensions (Word 97SR2)

    Is there a statement or function that returns the number of dimensions in an array?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    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)?
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Array Dimensions (Word 97SR2)

    The actual number of dimensions.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    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?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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. #9
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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>?
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. #13
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Array Dimensions (Word 97SR2)

    Whoops, Scuttlebutt alert.

    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.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  14. #14
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Array Dimensions (Word 97SR2)

    Ahhh, he is indeed.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  15. #15
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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 LastLast

Posting Permissions

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