• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

Ubound of second element in a 2-dimensional array

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!
0
LovinSpoonful
Asked:
LovinSpoonful
  • 3
  • 2
1 Solution
 
Patrick MatthewsCommented:
Hi LovinSpoonful,

UBound(NameOfArray, DImensionNumber)

Regards,

Patrick
0
 
Patrick MatthewsCommented:
LovinSpoonful,

In your case:

UBound(sName, 2)

Regards,

Patrick
0
 
jkaiosIT DirectorCommented:
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.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LovinSpoonfulAuthor Commented:
Gee, I feel foolish...
0
 
LovinSpoonfulAuthor Commented:
Thanks alot for your help.
0
 
Patrick MatthewsCommented:
> Gee, I feel foolish...

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

> Thanks alot for your help.

You're most welcome.

Patrick
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now