Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1226
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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