?
Solved

Ubound of second element in a 2-dimensional array

Posted on 2006-10-27
6
Medium Priority
?
1,220 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!
0
Comment
Question by:LovinSpoonful
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 17822742
Hi LovinSpoonful,

UBound(NameOfArray, DImensionNumber)

Regards,

Patrick
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 17822744
LovinSpoonful,

In your case:

UBound(sName, 2)

Regards,

Patrick
0
 
LVL 12

Expert Comment

by:jkaios
ID: 17831767
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:LovinSpoonful
ID: 17861931
Gee, I feel foolish...
0
 

Author Comment

by:LovinSpoonful
ID: 17861938
Thanks alot for your help.
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 17865991
> 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question