Your source for ASP-related frequently asked questions and answers! : ASP FAQS : Arrays

Question: How can I determine the upper or lower bounds of an array?

Answer: To determine the upper bound of an array, use the UBound function. The UBound function can take two parameters - the first parameter is required, and is the variable name of the array whose upper bound you are interested in; the second parameter is optional and is the dimension of the array whose upper bound you are interested in. If the second parameter is omitted, a value of 1 is assumed.

UBound(ArrayVariable[, Dimension])

To determine the lower bound, you can use LBound, which uses the same arguments as UBound, but there is really little point in doing so. In VBScript all array lower bounds are always zero.

For more info, check out the technical docs for UBound() and LBound().

FAQ posted by Scott Mitchell at 9/24/2000 3:59:11 PM to the Arrays category. This FAQ has been viewed 55,032 times.

Copyright 2018 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers