LBound Function (Visual Basic)
Returns the lowest available subscript for the indicated dimension of an array.
Public Function LBound( _ ByVal Array As System.Array, _ Optional ByVal Rank As Integer = 1 _ ) As Integer
Integer. The lowest value the subscript for the specified dimension can contain. LBound always returns 0 as long as Array has been initialized, even if it has no elements, for example if it is a zero-length string. If Array is Nothing, LBound throws an ArgumentNullException.
Array is Nothing.
Rank < 1 or Rank is greater than the rank of Array.
See the "Error number" column if you are upgrading Visual Basic 6.0 applications that use unstructured error handling. (You can compare the error number against the Number Property (Err Object).) However, when possible, you should consider replacing such error control with Structured Exception Handling Overview for Visual Basic.
Since array subscripts start at 0, the lowest available subscript for every dimension is always 0.
For an array with the following dimensions, LBound returns the values in the following table:
Dim a(100, 5, 4) As Byte
Call to LBound
The following example uses the LBound function to determine the lowest available subscript for the indicated dimension of an array.
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)