Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: GS Newsgroups: comp.lang.basic.visual.misc,microsoft.public.vb.general.discussion Subject: Re: Arrays Q Date: Wed, 21 Dec 2011 14:18:58 -0500 Organization: A noiseless patient Spider Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 21 Dec 2011 19:19:00 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="UVJBuiIZprDyxzUkJsiwfw"; logging-data="21291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uF/x8ot8/jq76ALb1Ot80" X-Antivirus-Status: Clean X-Newsreader: MesNews/1.08.03.00-gb X-Antivirus: avast! (VPS 111221-1, 12/21/2011), Outbound message Cancel-Lock: sha1:36sRimzgdQY/srSljVsMiVpMGjQ= X-ICQ: 543516788 Xref: x330-a1.tempe.blueboxinc.net comp.lang.basic.visual.misc:578 MikeD expressed precisely : > "GS" wrote in message news:jct8o5$33p$1@dont-email.me... >> I'm looking for an efficient way to get the UBound for all dims of a >> multi-dim array. Any suggestions would be greatly appreciated. >> > > > The UBound function has an optional parameter for specifying which dimension > (as does the LBound function). I'm guessing there must be more to your > question than just that. Thanks Mike! Yes, I know how to determine the UBound for each dim if dims are known. Since I've always built my own multi-dim arrays from scratch I've been able to determine how many dims and so can query UBound(arr, 1), UBound(arr, 2), and so on if I already know how many dims. 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. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc