We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Ubound of second element in a 2-dimensional array

LovinSpoonful
on
Medium Priority
1,247 Views
Last Modified: 2008-02-01
In VB6, is there a way to find the ubound of the second element in a 2-d array?

For instance, if I had an array dimensioned like this:  sName(0 to 50, 0 to 100)
and I wanted to later get Ubound(sName)  how do I get the 100 value?

thanks!
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2010
Commented:
Hi LovinSpoonful,

UBound(NameOfArray, DImensionNumber)

Regards,

Patrick

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2010

Commented:
LovinSpoonful,

In your case:

UBound(sName, 2)

Regards,

Patrick
jkaiosIT Director

Commented:
The UBound() function has two parameters:  The first one the "name" of the array variable; and the second one is the "dimension" parameter (which is optional) and is a whole number indicating which dimension's upper bound is returned.  And because the second param is optional, if omitted, 1 is assumed.

Therefore:

  UBound(sName) ... will return 50  = which is the same as UBound(sName, 1)

In your case:

  See Patrick's example.

Author

Commented:
Gee, I feel foolish...

Author

Commented:
Thanks alot for your help.
CERTIFIED EXPERT
Top Expert 2010

Commented:
> Gee, I feel foolish...

No need for that, we're all learning here :)

> Thanks alot for your help.

You're most welcome.

Patrick
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.