Returns the lowest available subscript for the indicated dimension of an array.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
- Type: System.Array
Required. Array of any data type. The array in which you want to find the lowest possible subscript of a dimension.
- Type: System.Int32
Optional. Integer. The dimension for which the lowest possible subscript is to be returned. Use 1 for the first dimension, 2 for the second, and so on. If Rank is omitted, 1 is assumed.
Return ValueType: System.Int32
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.
For more detailed information, see the Visual Basic topic LBound Function (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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.