5 out of 8 rated this helpful - Rate this topic

LBound Function

Returns the smallest available subscript for the indicated dimension of an array.


                      LBound(arrayname[, dimension])
arrayname

Name of the array variable; follows standard variable naming conventions.

dimension

Whole number indicating which dimension's lower bound is returned. Use 1 for the first dimension, 2 for the second, and so on. If dimension is omitted, 1 is assumed.

The LBound function is used with the UBound function to determine the size of an array. Use the UBound function to find the upper limit of an array dimension.

The lower bound for any dimension is always 0.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Example for WSH

Option Explicit

Dim sFutureArray, MyArray, x, sText

sFutureArray ="Some day this example will look boring to me"

MyArray = Split (sFutureArray, " ", -1, 1)
sText = "The array holds " & UBound (MyArray) - LBound(MyArray) + 1 & " values. The values are the following:" & VBlf
For x = LBound(MyArray) to UBound (MyArray)
 sText = sText & "MyArray(" & x & ")" & VBTab & MyArray(x) & VBlf
Next
WScript.Echo sText